@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

:root {
    /* Cores Base do Diário */
    --primary-color: #6a11cb; /* Roxo */
    --secondary-color: #2575fc; /* Azul */
    --text-color: #333; /* Texto padrão dentro do container */
    --light-text-color: #f8f8f8;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0, 0, 0, 0.15);
    --success-color: #28a745;
    --error-color: #dc3545;

    /* Cores de Humor */
    --mood-feliz: #f9ca24;
    --mood-ok: #a5b1c2;
    --mood-triste: #3498db;
    --mood-ansioso: #ff7675;
    --mood-cansado: #636e72;
    --mood-irritado: #d63031;

    /* Cores para novo Header/Footer */
    --header-bg-color: #0056b3; /* Azul para o header */
    --header-text-color: #ffffff; /* Branco */
    --header-subtitle-color: #ffeb3b; /* Amarelo */
    --footer-bg-color: #333; /* Cinza escuro para o footer */
    --footer-text-color: #ccc; /* Cinza claro para texto do footer */
    --footer-link-color: #ffffff; /* Branco para links do footer */

    /* Cor/Opacidade do Container Principal do App */
    --container-bg-color: rgba(255, 255, 255, 0.85); /* Branco com 85% de opacidade */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    color: var(--text-color); /* Cor padrão para texto fora do container */
    line-height: 1.6;
    /* === IMAGEM DE FUNDO === */
    background-image: url('diario-humorx.jpg'); /* <<< Nome da sua imagem */
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    /* ====================== */
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 0; /* Sem padding no body */
}

/* === ESTILOS DO NOVO HEADER === */
.header-compact {
    background-color: var(--header-bg-color); /* Fundo azul */
    color: var(--header-text-color);
    padding: 10px 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.header-compact-content {
    display: flex;
    align-items: center;
    gap: 15px;
    /* max-width: 1200px; */
    width: 100%;
    justify-content: center;
}

.header-logo {
    height: 40px;
    width: auto;
}

.header-compact-text {
    text-align: center;
}

.header-compact-text h1 {
    color: var(--header-text-color); /* Branco */
    font-size: 1.5rem;
    margin: 0;
    font-weight: 600;
}

.header-compact-text p {
    color: var(--header-subtitle-color); /* Amarelo */
    font-size: 0.9rem;
    margin: 0;
    font-weight: 300;
}
/* ============================== */

/* === CONTAINER PRINCIPAL DO APP (COM TRANSPARÊNCIA) === */
.container {
    max-width: 550px; /* Largura original */
   /* max-width: 800px;  Largura original */
    width: 95%; /* Usa porcentagem para ser responsivo */
    background-color: var(--container-bg-color); /* <<< FUNDO SEMI-TRANSPARENTE */
    padding: 25px 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow-color);
    margin-top: 25px;
    margin-bottom: auto; /* Empurra footer para baixo */
    flex-grow: 1;
    color: var(--text-color); /* Garante texto escuro dentro do container */
}
/* ======================================================= */

/* Título opcional DENTRO do container (se usar) */
.app-title {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 25px;
    font-size: 1.6rem;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
}

section {
    /* Fundo transparente pois o container já tem fundo */
    background-color: transparent;
    padding: 0; /* Padding já está no container */
    margin-bottom: 30px;
}
section:last-of-type {
    margin-bottom: 0;
}

h2 { /* Títulos das seções internas */
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    font-size: 1.4rem;
}

/* Formulário de Entrada */
.mood-entry label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--text-color);
}

.mood-entry input[type="date"],
.mood-entry textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    background-color: #fff; /* Garante fundo branco sólido para inputs */
    color: var(--text-color); /* Garante texto escuro */
}

.mood-entry input[type="date"]:focus,
.mood-entry textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.25);
}

.mood-entry textarea {
    min-height: 80px;
    resize: vertical;
}

.date-selector {
    margin-bottom: 20px;
}

.mood-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.mood-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: transform 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
    min-width: 70px;
    text-align: center;
    background-color: rgba(238, 238, 238, 0.5); /* Fundo leve para melhor leitura */
}

.mood-option i {
    font-size: 2.5em;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.mood-option span {
    font-size: 0.85em;
    font-weight: 400;
    color: var(--text-color);
}

/* Cores específicas dos ícones */
.mood-option[data-mood="feliz"] i { color: var(--mood-feliz); }
.mood-option[data-mood="ok"] i { color: var(--mood-ok); }
.mood-option[data-mood="triste"] i { color: var(--mood-triste); }
.mood-option[data-mood="ansioso"] i { color: var(--mood-ansioso); }
.mood-option[data-mood="cansado"] i { color: var(--mood-cansado); }
.mood-option[data-mood="irritado"] i { color: var(--mood-irritado); }

.mood-option:hover {
    transform: translateY(-3px);
    background-color: #eee;
}

.mood-option.selected {
    border: 2px solid var(--secondary-color);
    background-color: rgba(37, 117, 252, 0.2); /* Fundo azul mais forte */
    transform: scale(1.05);
}
/* Cores da borda na seleção */
.mood-option[data-mood="feliz"].selected { border-color: var(--mood-feliz); background-color: rgba(249, 202, 36, 0.2); }
.mood-option[data-mood="ok"].selected { border-color: var(--mood-ok); background-color: rgba(165, 177, 194, 0.2); }
.mood-option[data-mood="triste"].selected { border-color: var(--mood-triste); background-color: rgba(52, 152, 219, 0.2); }
.mood-option[data-mood="ansioso"].selected { border-color: var(--mood-ansioso); background-color: rgba(255, 118, 117, 0.2); }
.mood-option[data-mood="cansado"].selected { border-color: var(--mood-cansado); background-color: rgba(99, 110, 114, 0.2); }
.mood-option[data-mood="irritado"].selected { border-color: var(--mood-irritado); background-color: rgba(214, 48, 49, 0.2); }

.mood-entry button {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: var(--secondary-color);
    color: var(--light-text-color);
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 10px;
}

.mood-entry button:hover {
    background-color: var(--primary-color);
    transform: translateY(-2px);
}

.mood-entry button:active {
    transform: translateY(0);
}

.feedback {
    text-align: center;
    margin-top: 15px;
    font-weight: bold; /* Deixa o feedback mais visível */
    min-height: 1.2em;
    color: var(--text-color); /* Cor base escura */
}
.feedback.success { color: var(--success-color); }
.feedback.error { color: var(--error-color); }

/* Histórico de Humor */
.mood-history ul {
    list-style: none;
    padding: 0;
    max-height: 400px;
    overflow-y: auto;
}

.mood-history li {
    background-color: rgba(253, 253, 253, 0.8); /* Fundo levemente transparente */
    border: 1px solid var(--border-color);
    border-left-width: 5px;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: box-shadow 0.3s ease;
}

.mood-history li:hover {
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.mood-history li .entry-info {
    flex-grow: 1;
    margin-right: 15px;
}

.mood-history li strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.1rem;
    color: var(--primary-color);
}
.mood-history li strong span.mood-icon {
    margin-right: 8px;
    font-size: 1.3em;
    vertical-align: middle;
}
.mood-history li p {
    margin: 5px 0 0 0;
    font-size: 0.95rem;
    color: #555;
    white-space: pre-wrap;
}

/* Cores da borda esquerda baseadas no humor */
.mood-history li[data-mood="feliz"] { border-left-color: var(--mood-feliz); }
.mood-history li[data-mood="ok"] { border-left-color: var(--mood-ok); }
.mood-history li[data-mood="triste"] { border-left-color: var(--mood-triste); }
.mood-history li[data-mood="ansioso"] { border-left-color: var(--mood-ansioso); }
.mood-history li[data-mood="cansado"] { border-left-color: var(--mood-cansado); }
.mood-history li[data-mood="irritado"] { border-left-color: var(--mood-irritado); }

.mood-history .delete-btn {
    background: none;
    border: none;
    color: var(--error-color);
    cursor: pointer;
    font-size: 1.2em;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
}
.mood-history .delete-btn:hover {
    opacity: 1;
}

.mood-history .no-entries {
    text-align: center;
    color: #777;
    padding: 20px;
    border: none;
    background-color: rgba(230, 230, 230, 0.5); /* Fundo leve */
    border-radius: 6px;
}

/* Análise */
.mood-analysis p {
    text-align: center;
    font-size: 1rem;
    color: #444;
    line-height: 1.7;
}

/* === ESTILOS DO NOVO FOOTER === */
.tool-footer {
    background-color: var(--footer-bg-color);
    color: var(--footer-text-color);
    padding: 15px 20px;
    text-align: center;
    font-size: 0.9em;
    width: 100%;
    flex-shrink: 0;
    margin-top: 25px; /* Espaço acima do footer */
}

.tool-footer-links {
    margin-bottom: 8px;
}

.tool-footer-links a {
    color: var(--footer-link-color);
    text-decoration: none;
    margin: 0 5px;
}

.tool-footer-links a:hover {
    text-decoration: underline;
}
/* ============================== */

/* Responsividade */
@media (max-width: 768px) { /* Ajuste breakpoint se necessário */
    .container {
        max-width: 90%; /* Um pouco mais largo em tablets */
        padding: 20px;
    }
}

@media (max-width: 600px) {
     .header-compact {
         padding: 8px 10px;
     }
     .header-compact-content {
         gap: 10px;
     }
     .header-logo {
         height: 30px;
     }
     .header-compact-text h1 {
         font-size: 1.1rem;
     }
      .header-compact-text p {
         font-size: 0.75rem;
     }

    .container {
        max-width: 100%;
        width: 100%;
        border-radius: 0;
        box-shadow: none;
        padding: 15px;
        margin-top: 0; /* Remove margem superior */
        margin-bottom: 0; /* Remove margem inferior */
        border: none; /* Remove borda se houver */
    }

    .app-title {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }

    section {
        margin-bottom: 20px;
    }

    h2 {
        font-size: 1.2rem;
    }

    .mood-options {
        gap: 8px;
        justify-content: space-around;
    }

    .mood-option {
        min-width: 50px;
        padding: 6px;
    }

     .mood-option i {
        font-size: 1.6em;
    }

    .mood-option span {
        font-size: 0.65em;
    }

    .mood-entry button {
        padding: 10px;
        font-size: 1rem;
    }

    #entries-list li {
         align-items: center;
         padding: 10px;
    }
     #entries-list li strong {
         font-size: 1rem;
     }
     #entries-list li p {
         font-size: 0.9rem;
     }

     .tool-footer {
         padding: 10px;
         font-size: 0.8em;
         margin-top: 0; /* Remove margem */
     }
}

@media (max-width: 480px) {
     .header-compact-content {
         flex-direction: column;
         gap: 5px;
     }
     .mood-options {
         gap: 5px; /* Ainda menor espaço */
     }
      .mood-option {
         min-width: 45px;
         padding: 5px;
     }
      .mood-option i {
         font-size: 1.5em;
     }
       .mood-option span {
         display: none; /* Oculta texto em telas muito pequenas */
     }
}