/* ============================================================
   ARQUIVO: dashboard.css
   PÁGINA:  dashboard.html (Painel Principal / Menu)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
    --app-header-bg: var(--azul-principal);
    --azul-principal: #3178C6;    /* Azul — cor da topbar do Dashboard */
    --cor-fundo: #F4F7FB;         /* Fundo cinza azulado */
    --texto-escuro: #333333;      /* Texto dos rótulos e menu */
    --texto-claro: #777777;       /* Texto do rodapé */
    --branco: #FFFFFF;            /* Fundo das topbars e rodapé */
    --cor-borda: #E0E0E0;         /* Linha do rodapé */
    --fonte-padrao: 'Poppins', sans-serif;
    --sombra-leve: 0 2px 4px rgba(0, 0, 0, 0.05);
    --sombra-media: 0 4px 6px rgba(0, 0, 0, 0.1);
    --animacao: all 0.3s ease;
}

/* Overrides para Modo Noturno */
body.dark-mode {
    --cor-fundo: #2c2c2c;
    --texto-escuro: #FFFFFF;
    --texto-claro: #FFFFFF;
    --branco: #FFFFFF; /* Garante que fontes que usam branco/preto fiquem brancas */
    --cor-surface: #383838; /* Cor cinza para cartões e containers */
    --cor-borda: #444444;
    --sombra-leve: 0 2px 4px rgba(0, 0, 0, 0.3);
    --sombra-media: 0 4px 6px rgba(0, 0, 0, 0.4);
}

body.dark-mode header.barra-topo { background-color: var(--azul-principal) !important; color: white !important; }
body.dark-mode header.barra-topo * { color: white !important; }
body.dark-mode .item-menu { background-color: transparent; }
body.dark-mode .rodape { background-color: var(--cor-surface); color: white; border-top-color: var(--cor-borda); }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--fonte-padrao);
    background-color: var(--cor-fundo);
    color: var(--texto-escuro);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main { padding-bottom: 2rem; }

/* Centraliza e limita a largura do conteúdo */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ----------------------------------------------------------
   BARRA SUPERIOR (.barra-topo)
   Faixa azul no topo com o título e botão "Sair".
   "position: relative" permite que o botão seja
   posicionado no canto direito com position: absolute.
   ---------------------------------------------------------- */
#user-companion.companion-animated {
    transform-origin: center;
    will-change: transform, filter;
}

#user-companion.companion-animated[data-anim="happy"] {
    animation: companion-happy 2s ease-in-out infinite;
}

#user-companion.companion-animated[data-anim="sleepy"] {
    animation: companion-sleepy 3.2s ease-in-out infinite;
}

#user-companion.companion-animated[data-anim="night"] {
    animation: companion-night 3.8s ease-in-out infinite;
}

@keyframes companion-happy {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    25% { transform: translateY(-2px) rotate(-4deg) scale(1.04); }
    50% { transform: translateY(0) rotate(3deg) scale(1.02); }
    75% { transform: translateY(-1px) rotate(-2deg) scale(1.03); }
}

@keyframes companion-sleepy {
    0%, 100% { transform: translateY(0) rotate(0deg); opacity: 1; }
    35% { transform: translateY(1px) rotate(-5deg); opacity: 0.92; }
    70% { transform: translateY(0) rotate(3deg); opacity: 0.98; }
}

@keyframes companion-night {
    0%, 100% { transform: translateY(0) scale(1); opacity: 1; }
    40% { transform: translateY(1px) scale(0.98); opacity: 0.92; }
    70% { transform: translateY(0) scale(1.01); opacity: 1; }
}

.companion-chat {
    position: absolute;
    top: 24px;
    left: 2px;
    z-index: 1200;
}

.companion-balloon {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    border: 2px solid #2f3f57;
    border-radius: 22px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18), inset 0 0 0 2px #ffffff;
    padding: 14px 16px;
    min-width: 360px;
    max-width: 520px;
}

.companion-balloon::before {
    content: "";
    position: absolute;
    top: -11px;
    left: 28px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 11px solid #2f3f57;
}

.companion-balloon::after {
    content: "";
    position: absolute;
    top: -7px;
    left: 29px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 10px solid #ffffff;
}

.companion-message {
    color: #2f3f57;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.32;
}

.companion-reply-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 12px;
}

.companion-option-btn {
    border: 1.5px solid #6f85a6;
    background: #f4f8ff;
    color: #2f3f57;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    padding: 7px 14px;
    cursor: pointer;
    transition: var(--animacao);
}

.companion-option-btn:hover {
    background: #2f3f57;
    color: #ffffff;
    border-color: #2f3f57;
}

.companion-confetti-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 9999;
}

.companion-confetti-piece {
    position: absolute;
    top: -16px;
    width: 9px;
    height: 13px;
    border-radius: 2px;
    opacity: 0.95;
    animation: companion-confetti-fall linear forwards;
}

@keyframes companion-confetti-fall {
    0% {
        transform: translate3d(0, -10px, 0) rotate(0deg);
        opacity: 0.98;
    }
    100% {
        transform: translate3d(var(--x-drift, 0px), 105vh, 0) rotate(640deg);
        opacity: 0.12;
    }
}

body.dark-mode .companion-balloon {
    background: linear-gradient(180deg, #243448 0%, #1d2d40 100%);
    border-color: #8eb5ea;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35), inset 0 0 0 2px rgba(142, 181, 234, 0.12);
}

body.dark-mode .companion-balloon::before {
    border-bottom-color: #8eb5ea;
}

body.dark-mode .companion-balloon::after {
    border-bottom-color: #243448;
}

body.dark-mode .companion-message {
    color: #d8e9ff;
}

body.dark-mode .companion-option-btn {
    background: #1e3148;
    border-color: #597ba5;
    color: #d8e9ff;
}

body.dark-mode .companion-option-btn:hover {
    background: #8eb5ea;
    border-color: #8eb5ea;
    color: #102034;
}

@media (max-width: 760px) {
    .companion-chat {
        left: 0;
    }

    .companion-balloon {
        min-width: 0;
        max-width: min(420px, calc(100vw - 24px));
        padding: 12px 13px;
    }

    .companion-message {
        font-size: 16px;
    }
}

/* ----------------------------------------------------------
   RODAPÉ (.rodape)
   Barra informativa no fundo da página.
   "margin-top: auto" sempre gruda no fundo.
   ---------------------------------------------------------- */
/* ----------------------------------------------------------
   ÁREA PRINCIPAL DO DASHBOARD (.area-dashboard)
   "flex: 1" ocupa todo o espaço entre a topbar e o rodapé.
   Centraliza os ícones vertical e horizontalmente.
   ---------------------------------------------------------- */
.area-dashboard {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
}

.dashboard-content {
    width: 100%;
}

/* ----------------------------------------------------------
   GRADE DE MENU (.grade-menu)
   Coloca os três ícones de navegação lado a lado.
   "flex-wrap: wrap" quebra linha em telas menores.
   ---------------------------------------------------------- */
.grade-menu {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* ----------------------------------------------------------
   ITEM DE MENU (.item-menu)
   Cada botão de navegação (imagem + texto em coluna).
   Sobe e aumenta levemente ao passar o mouse.
   ---------------------------------------------------------- */
.item-menu {
    display: flex;
    flex-direction: column; /* Imagem em cima, texto embaixo */
    align-items: center;
    text-decoration: none;
    color: var(--texto-escuro);
    transition: var(--animacao);
    cursor: pointer;
}

.item-menu:hover {
    transform: translateY(-5px) scale(1.05);
}

/* Texto descritivo abaixo do ícone */
.rotulo-menu {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

/* Lembretes de escala */
.dashboard-reminders {
    width: min(100%, 940px);
    margin: 3rem auto 0;
    padding: 1.25rem;
    border: 1px solid #d9eaed;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(27, 48, 51, 0.08);
}

.dashboard-reminders-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: .85rem;
}

.dashboard-reminders-heading-copy {
    min-width: 0;
}

.dashboard-reminders-send-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-left: auto;
    padding: .5rem .72rem;
    border: 0;
    border-radius: 8px;
    background: #3BA7B5;
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease, opacity .2s ease;
}

.dashboard-reminders-send-button:hover { background: #62C0CC; }
.dashboard-reminders-send-button:disabled { cursor: wait; opacity: .7; }
.dashboard-reminders-send-button[hidden] { display: none; }

.dashboard-reminders-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(27, 48, 51, .42);
    backdrop-filter: blur(3px);
}

.dashboard-reminders-confirm {
    width: min(100%, 390px);
    padding: 1.35rem;
    border: 1px solid #d9e7e9;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(27, 48, 51, .22);
    color: #1B3033;
    font-family: 'Exo 2', sans-serif;
}

.dashboard-reminders-confirm-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin-bottom: .8rem;
    border-radius: 12px;
    background: #e1f4f6;
    color: #218a98;
    font-size: 22px;
}

.dashboard-reminders-confirm h3 { margin: 0; font-size: 19px; }
.dashboard-reminders-confirm p { margin: .5rem 0 1.1rem; color: #586c70; font-size: 14px; line-height: 1.45; }
.dashboard-reminders-confirm-actions { display: flex; justify-content: flex-end; gap: .55rem; }
.dashboard-reminders-confirm-actions button {
    min-height: 36px;
    padding: .45rem .8rem;
    border-radius: 8px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.dashboard-reminders-confirm-cancel { border: 1px solid #cbdcde; background: #fff; color: #43585b; }
.dashboard-reminders-confirm-send { border: 1px solid #3BA7B5; background: #3BA7B5; color: #fff; }
.dashboard-reminders-confirm-send:hover { background: #62C0CC; border-color: #62C0CC; }

.dashboard-reminders-heading-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 12px;
    color: #ffffff;
    background: #3BA7B5;
    font-size: 22px;
}

.dashboard-reminders h2 {
    color: #1B3033;
    font-size: 19px;
    line-height: 1.2;
}

.dashboard-reminders-content {
    display: grid;
    gap: 1.15rem;
}

.dashboard-reminder-topic + .dashboard-reminder-topic {
    padding-top: 1.15rem;
    border-top: 1px solid #e2ecee;
}

.dashboard-reminder-topic-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 .65rem;
    color: #426165;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.dashboard-reminder-topic-title i {
    color: #3BA7B5;
    font-size: 17px;
}

.dashboard-reminder-topic-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.dashboard-reminder-item {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 48px;
    padding: 7px 10px;
    border: 1px solid #e2ecee;
    border-radius: 10px;
    color: #1B3033;
    background: #faffff;
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.dashboard-reminder-item:hover,
.dashboard-reminder-item:focus-visible {
    border-color: #3BA7B5;
    box-shadow: 0 5px 14px rgba(59, 167, 181, 0.16);
    outline: none;
    transform: translateY(-2px);
}

.dashboard-reminder-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #e1f4f6;
    color: #247d88;
    font-size: 14px;
}

.dashboard-reminder-item--warning .dashboard-reminder-icon { background: #fff3d9; color: #b56b00; }
.dashboard-reminder-item--danger .dashboard-reminder-icon { background: #ffe9e7; color: #bd4237; }
.dashboard-reminder-item--success .dashboard-reminder-icon { background: #e4f6ec; color: #278452; }

.dashboard-reminder-copy { min-width: 0; }
.dashboard-reminder-count { display: block; font-size: 15px; font-weight: 700; line-height: 1.1; }
.dashboard-reminder-label { display: block; margin-top: 1px; color: #627477; font-size: 11px; line-height: 1.2; }

.dashboard-reminders-loading,
.dashboard-reminders-empty,
.dashboard-reminders-error {
    grid-column: 1 / -1;
    padding: .5rem;
    color: #627477;
    font-size: 14px;
    text-align: center;
}

.dashboard-reminders-error { color: #a13b34; }

body.dark-mode .dashboard-reminders {
    background: var(--cor-surface);
    border-color: var(--cor-borda);
}

body.dark-mode .dashboard-reminders h2,
body.dark-mode .dashboard-reminder-item { color: #ffffff; }
body.dark-mode .dashboard-reminder-label,
body.dark-mode .dashboard-reminders-loading,
body.dark-mode .dashboard-reminders-empty { color: #d1d7d8; }
body.dark-mode .dashboard-reminder-item { background: #303f40; border-color: #476264; }
body.dark-mode .dashboard-reminder-topic + .dashboard-reminder-topic { border-top-color: #476264; }
body.dark-mode .dashboard-reminder-topic-title { color: #d1d7d8; }
body.dark-mode .dashboard-reminders-send-button { background: #3BA7B5; }
body.dark-mode .dashboard-reminders-confirm { background: #26383a; border-color: #476264; color: #fff; }
body.dark-mode .dashboard-reminders-confirm p { color: #d1d7d8; }
body.dark-mode .dashboard-reminders-confirm-cancel { background: transparent; border-color: #5d7779; color: #e8eeee; }

.dashboard-version-note {
    text-align: center;
    margin-bottom: 15px;
    font-family: var(--fonte-padrao);
    font-size: 13px;
    color: var(--texto-claro);
}

.dashboard-version-link {
    color: var(--azul-principal);
    text-decoration: none;
    font-weight: 600;
}

.dashboard-version-link:hover {
    text-decoration: underline;
}

/* Animação de entrada suave */
.entrada-suave { opacity: 1; }

@media (max-width: 760px) {
    .area-dashboard { align-items: flex-start; }
    .grade-menu { gap: 28px; }
    .dashboard-reminders { margin-top: 2.25rem; }
    .dashboard-reminder-topic-cards { grid-template-columns: 1fr; }
}
