/* /style.css */

/* Paleta de cores base */
:root {
  --background: 240 10% 3.9%;
  --foreground: 0 0% 98%;
  --card: 240 10% 3.9%;
  --card-foreground: 0 0% 98%;
  --popover: 240 10% 3.9%;
  --popover-foreground: 0 0% 98%;
  --primary: 48 96% 53%;
  --primary-foreground: 240 6% 10%;
  --secondary: 240 4% 16%;
  --secondary-foreground: 0 0% 98%;
  --muted: 240 4% 16%;
  --muted-foreground: 240 5% 65%;
  --accent: 240 4% 16%;
  --accent-foreground: 0 0% 98%;
  --destructive: 0 63% 31%;
  --destructive-foreground: 0 0% 98%;
  --border: 240 4% 16%;
  --input: 240 4% 16%;
  --ring: 48 96% 53%;
  --radius: 0.5rem;
}

/* degradê dourado */
.bg-gradient-gold {
  background-image: linear-gradient(to bottom right, hsl(var(--primary)), hsl(38, 92%, 60%));
}
.bg-gradient-gold:hover {
  background-image: linear-gradient(to bottom right, hsl(48, 95%, 55%), hsl(38, 92%, 62%));
}

/* texto com degradê animado */
.text-gradient-animated {
  display: inline-block;
  background-image: linear-gradient(-45deg, hsl(var(--primary)) 25%, #ffffff 50%, hsl(var(--primary)) 75%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: animate-gradient 3s linear infinite;
}
@keyframes animate-gradient { to { background-position: 200% center; } }

/* Notificações (Toasts) */
.toast {
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    color: hsl(var(--foreground));
    font-weight: 500;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    animation: toast-in 0.3s ease-out forwards;
    opacity: 0;
}
.toast.success { background-color: #22c55e; border: 1px solid #4ade80; }
.toast.error { background-color: #ef4444; border: 1px solid #f87171; }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }


/* --- ESTILOS ATUALIZADOS PARA A AGENDA (FullCalendar) --- */
#calendar-container {
    --fc-border-color: hsl(var(--border));
    --fc-daygrid-event-dot-width: 8px;
    --fc-list-event-dot-width: 10px;
    --fc-event-border-color: transparent;
    --fc-event-text-color: hsl(var(--primary-foreground));
    --fc-today-bg-color: hsla(var(--primary), 0.1);
}
#calendar a { color: hsl(var(--foreground)); text-decoration: none; }
.fc .fc-toolbar-title { color: hsl(var(--foreground)); font-family: 'Playfair Display', serif; }
.fc .fc-button-primary {
    background-color: hsl(var(--secondary));
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
    font-weight: 600;
    transition: background-color 0.2s;
    border-radius: 9999px; /* Botões arredondados */
    padding: 0.5rem 1rem;
}
.fc .fc-button-primary:not(:disabled):active, .fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}
.fc .fc-button-primary:hover {
    background-color: hsl(var(--muted));
}
.fc-daygrid-day.fc-day-today {
    background-color: var(--fc-today-bg-color) !important;
}
.fc-day-header, .fc-col-header-cell-cushion {
    color: hsl(var(--muted-foreground));
}
/* CORREÇÃO: Arestas arredondadas para o calendário */
.fc {
    border-radius: 0.5rem;
    overflow: hidden;
}
.fc-event {
    border-radius: 4px !important;
    padding: 2px 4px;
    font-weight: 500;
}
.fc .fc-button-group {
    border-radius: 9999px;
    background-color: hsl(var(--secondary));
    padding: 0.25rem;
}

/* CORREÇÃO: Responsividade para telemóveis */
@media (max-width: 640px) {
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 0.75rem;
    }
    .fc .fc-toolbar-title {
        font-size: 1.5rem; /* 24px */
    }
    .fc .fc-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.875rem; /* 14px */
    }
}
/* Estilização do Mini Calendário (Vanilla JS Datepicker) - VERSÃO CORRIGIDA */
:root {
  --datepicker-bg: transparent;
  --datepicker-text-color: hsl(var(--foreground));
  --datepicker-border-color: transparent;
  --datepicker-disabled-color: hsl(var(--muted-foreground) / 0.5);
  --datepicker-focused-color: hsl(var(--primary));
  --datepicker-selected-color: hsl(var(--primary-foreground)); /* Corrigido para melhor contraste */
  --datepicker-selected-bg: hsl(var(--primary));
  --datepicker-range-bg: hsl(var(--primary) / 0.1);
  --datepicker-view-transition: none;
}
/* NOVO: Força a centralização usando flexbox no container */
#mini-calendar-container {
    display: flex;
    justify-content: center;
}
.datepicker-picker {
  /* Removemos o margin:auto, pois o container agora controla */
  border-radius: 1rem;
  padding: 1rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
}
.datepicker-controls .button, .datepicker-header .datepicker-title {
  font-weight: 600;
  text-transform: capitalize;
}
.datepicker-controls .button:hover, .datepicker-header .datepicker-title:hover {
  background-color: hsl(var(--secondary));
}
/* Remove a grade/bordas entre os dias */
.datepicker-view .days .day, .datepicker-view .weekdays .weekday, .datepicker-view .calendar-weeks .week {
    border: none !important;
}
.datepicker-view .days .day {
    border-radius: 9999px; /* Deixa os dias redondos */
    font-weight: 500;
    height: 36px;
    width: 36px;
}
.datepicker-view .days .day.today:not(.selected) {
    color: hsl(var(--primary));
    font-weight: bold;
}
.datepicker-view .days .day.selected {
    font-weight: bold;
}
/* /style.css */

/* --- ESTILOS PARA O CARROSSEL DE CONTAS (NOVO) --- */

.account-carousel-container {
    position: relative;
}

.account-carousel {
    display: flex;
    overflow-x: auto; /* Permite o scroll horizontal */
    padding-bottom: 15px; /* Espaço para a barra de rolagem não ficar colada */
    
    /* Faz o scroll "grudar" nos itens, melhorando a experiência mobile */
    scroll-snap-type: x mandatory; 
    
    /* Esconde a barra de rolagem visualmente, mas mantém a funcionalidade */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.account-carousel::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.account-card {
    /* Define o tamanho de cada card no carrossel */
    flex: 0 0 200px; /* Não cresce, não encolhe, base de 200px de largura */
    margin-right: 12px;
    
    /* Centraliza o scroll no card */
    scroll-snap-align: start; 
    
    /* Estilos visuais */
    background-color: hsl(var(--secondary));
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

.account-card:hover {
    transform: translateY(-3px);
}

.account-card:last-child {
    margin-right: 0;
}

/* /style.css */

/* BARRA DE AÇÕES FIXA PARA MOBILE (VERSÃO FINAL) */
#mobile-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    background-color: hsl(var(--card));
    border-top: 1px solid hsl(var(--border));
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.action-button {
    background-color: transparent;
    border: 1px solid hsl(var(--primary)); /* BORDA DOURADA ADICIONADA */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 24px; /* Ajuste no padding */
    border-radius: 12px; /* Bordas mais arredondadas */
    transition: background-color 0.2s;
}

.action-button:active {
    background-color: hsl(var(--secondary));
}

/* Cor individual para o ícone de receita */
.action-button .icon-receita {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    color: #22c55e; /* VERDE */
}

/* Cor individual para o ícone de despesa */
.action-button .icon-despesa {
    width: 24px;
    height: 24px;
    margin-bottom: 2px;
    color: #ef4444; /* VERMELHO */
}

/* Cor para o texto do botão */
.action-button span {
    color: hsl(var(--muted-foreground));
}
/* Força o desaparecimento da barra de ações em telas grandes (desktop) */
@media (min-width: 1024px) {
    #mobile-action-bar {
        display: none !important;
    }
}
/* --- ESTILOS PARA O CARROSSEL DE CARTÕES (SWIPERJS) - VERSÃO CORRIGIDA --- */
.card-swiper {
    width: 100%;
    max-width: 500px; /* IMPORTANTE: Limita a largura no desktop para manter a elegância */
    margin-left: auto;
    margin-right: auto;
    padding-top: 20px;
    padding-bottom: 50px; /* Espaço para a paginação e setas */
}

.card-swiper .swiper-slide {
    background-position: center;
    background-size: cover;
    width: 300px; /* Largura de cada cartão, igual ao da pág. de configurações */
    height: auto;
    transition: opacity 0.3s ease, transform 0.3s ease; /* Adiciona transição suave */
}

/* Deixa os slides não ativos com menor opacidade, criando foco no slide central */
.card-swiper .swiper-slide:not(.swiper-slide-active) {
    opacity: 0.4;
    transform: scale(0.95);
}

/* Estilizando as setas e a paginação com a cor primária do seu tema */
.card-swiper .swiper-pagination,
.card-swiper .swiper-button-next,
.card-swiper .swiper-button-prev {
    color: hsl(var(--primary));
}

.card-swiper .swiper-button-next::after,
.card-swiper .swiper-button-prev::after {
    font-size: 24px !important;
    font-weight: bold;
}