/* Stili Generali e Reset */
body {
  font-family: 'Arial', sans-serif;
  background: #f0f9ff; /* Sfondo molto chiaro, quasi bianco-azzurro */
  color: #333; /* Grigio scuro per il testo principale */
  margin: 0;
  padding: 1em; /* Padding generale per il contenuto */
  text-align: center; /* Centra il testo a livello di blocco */
  line-height: 1.6; /* Migliora la leggibilità del testo */
}

/* Header dell'App */
header {
  background: #6EC1E4; /* Blu medio, colore primario */
  color: white; /* Testo bianco */
  padding: 1em;
  border-radius: 10px; /* Bordi arrotondati */
  margin-bottom: 2em; /* Spazio sotto l'header */
  box-shadow: 0 4px 8px rgba(0,0,0,0.1); /* Ombra leggera per profondità */
}

h1 {
    margin-top: 0; /* Rimuove il margine superiore predefinito dell'h1 */
    font-size: 2.2em; /* Dimensione del titolo principale */
}

p {
    font-size: 1.1em; /* Dimensione del paragrafo sotto il titolo */
}

/* Sezione Ruota delle Emozioni */
#emotion-wheel {
  margin-top: 2em;
  display: flex; /* Utilizza Flexbox per l'allineamento */
  justify-content: center; /* Centra orizzontalmente i bottoni */
  flex-wrap: wrap; /* Permette ai bottoni di andare a capo su schermi piccoli */
  gap: 1em; /* Spazio tra i bottoni */
  margin-bottom: 2em; /* Spazio sotto la ruota */
}

.emotion {
  background: #fff; /* Sfondo bianco per i bottoni */
  padding: 1em;
  border-radius: 50%; /* Rende i bottoni circolari */
  width: 80px; /* Larghezza fissa */
  height: 80px; /* Altezza fissa per renderli quadrati e poi circolari */
  box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Ombra leggera */
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer; /* Indica che è cliccabile */
  font-size: 3.5em; /* Dimensione raddoppiata per le emoji */
  transition: transform 0.2s ease-in-out; /* Animazione fluida al click */
}

.emotion:active {
    transform: scale(0.95); /* Effetto di "schiacciamento" al click */
}

/* Feedback Immediato dopo la Registrazione */
#log-feedback {
    background: #e0f2f7; /* Un blu più chiaro per il feedback */
    padding: 0.8em;
    border-radius: 8px; /* Bordi arrotondati */
    margin: 1em auto; /* Centra il blocco orizzontalmente */
    max-width: 300px; /* Limita la larghezza per renderlo compatto */
    color: #0056b3; /* Testo blu scuro */
    font-weight: bold; /* Testo in grassetto */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Ombra molto leggera */
}

/* Sezione per Registrare il Mood tramite Testo Libero */
#text-mood-entry {
    background: #ffffff; /* Sfondo bianco */
    padding: 1.5em;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-top: 2em;
    text-align: center; /* Centra il contenuto di questa sezione */
    max-width: 500px; /* Limita la larghezza */
    margin-left: auto;
    margin-right: auto; /* Centra il blocco */
}

#text-mood-entry h3 {
    color: #6EC1E4; /* Blu del tema per il titolo della sezione */
    margin-top: 0;
    margin-bottom: 1em;
    font-size: 1.6em;
}

#mood-text-input {
    width: calc(100% - 20px); /* 100% della larghezza del contenitore meno padding */
    padding: 10px;
    border: 1px solid #ccc; /* Bordo grigio chiaro */
    border-radius: 5px;
    font-family: 'Arial', sans-serif; /* Consistenza del font */
    font-size: 1em;
    resize: vertical; /* Permette all'utente di ridimensionare solo verticalmente */
    margin-bottom: 1em;
    box-sizing: border-box; /* Include padding e border nella larghezza */
}

#record-text-mood-btn {
    background-color: #FF9800; /* Material Design Orange 500 */
    color: white;
    border: none;
    padding: 0.8em 1.5em;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.2s ease-in-out; /* Animazione al passaggio del mouse */
}

#record-text-mood-btn:hover {
    background-color: #FB8C00; /* Orange 600 per l'hover */
}

/* --- SEZIONE PULSANTI DI NAVIGAZIONE (Inclusa "Focus" e "Ritrova Calma") --- */
#navigation-buttons-section {
    margin-top: 2em;
    padding: 1em;
    text-align: center;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
    display: flex; /* Usa flexbox per allineare i pulsanti */
    justify-content: center; /* Centra i pulsanti */
    gap: 1.5em; /* Spazio tra i pulsanti */
    flex-wrap: wrap; /* Permette ai pulsanti di andare a capo su schermi piccoli */
}

.app-nav-button {
    display: inline-block; /* Rende l'<a> un blocco con padding */
    background-color: #F44336; /* Material Design Red 500 (per Focus) */
    color: white;
    text-decoration: none;
    padding: 0.8em 1.8em;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.app-nav-button:hover {
    background-color: #E53935; /* Red 600 per l'hover */
    transform: translateY(-1px);
}

.app-nav-button:active {
    transform: translateY(0);
}

/* STILI PER IL PULSANTE "RITROVA CALMA" */
.calm-button {
    background-color: #03A9F4; /* Material Design Light Blue 500 (Ciano) */
    color: white; /* Testo bianco per un buon contrasto */
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.calm-button:hover {
    background-color: #039BE5; /* Light Blue 600 per l'hover */
    transform: translateY(-1px);
}

.calm-button:active {
    transform: translateY(0);
}

/* STILI PER IL PULSANTE "GUIDA" */
#guide-page-btn {
    background-color: #2196F3; /* Material Design Blue 500 */
    color: white;
    /* Le altre proprietà sono ereditate da .app-nav-button, ma puoi sovrascriverle se necessario */
}

#guide-page-btn:hover {
    background-color: #1976D2; /* Blue 700 per l'hover */
    transform: translateY(-1px);
}

#guide-page-btn:active {
    transform: translateY(0);
}


/* SEZIONE GESTIONE EMOZIONI */
#manage-emotions-section {
    margin-top: 2em;
    padding: 1.5em;
    background: #f0f9ff;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

#toggle-manage-emotions-btn {
    background-color: #4CAF50; /* Material Design Green 500 */
    color: white;
    border: none;
    padding: 0.8em 1.5em;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    margin-bottom: 1em;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: background-color 0.2s ease-in-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#toggle-manage-emotions-btn:hover {
    background-color: #43A047; /* Green 600 per l'hover */
}

/* Sezione Storico del Mood */
#mood-history {
    background: #ffffff;
    padding: 1.5em;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-top: 2em;
    text-align: left;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

#mood-history h2 {
    color: #4CAF50;
    text-align: center;
    margin-bottom: 1em;
    font-size: 1.8em;
}

#history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Stile base per gli elementi della lista (singoli e intestazioni di data) */
.history-item-base {
    background: #f9f9f9;
    border: 1px solid #eee;
    padding: 0.8em 1em;
    margin-bottom: 0.5em;
    border-radius: 5px;
    display: flex;
    align-items: center;
    font-size: 1.1em;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

/* Stile specifico per le singole voci di mood */
.history-item {
    justify-content: space-between;
}

.history-item .time {
    font-weight: bold;
    color: #555;
    flex-shrink: 0;
    margin-right: 1em;
}

.history-item .emotion-display {
    color: #007bff;
    font-weight: 600;
    font-size: 1.8em;
}

/* Stile specifico per le intestazioni di data cliccabili */
.history-date-header {
    background: #e9f5ff;
    border: 1px solid #b3d9ff;
    cursor: pointer;
    font-weight: bold;
    text-align: center;
    color: #0056b3;
    padding: 1em;
    margin-top: 1em;
    margin-bottom: 0.8em;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease-in-out;
}

.history-date-header:hover {
    background: #d9edf7;
}

.date-indicator-emojis {
    font-size: 2.5em;
    margin-left: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 50%;
}

/* Pulsante "Torna allo storico completo" */
#back-to-all-history {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 0.6em 1em;
    border-radius: 5px;
    cursor: pointer;
    margin-bottom: 1em;
    font-size: 0.9em;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: background-color 0.2s ease-in-out;
}

#back-to-all-history:hover {
    background-color: #0056b3;
}

/* Stili per il Footer */
footer {
    margin-top: 3em;
    padding: 1.5em 1em;
    background: #6EC1E4;
    color: white;
    text-align: center;
    font-size: 0.9em;
    border-radius: 10px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

footer p {
    margin: 0;
    font-size: 1em;
}

.footer-link { /* Stile per il link nel footer */
    color: white;
    text-decoration: none;
    font-weight: bold;
    transition: text-decoration 0.2s ease-in-out;
}

.footer-link:hover {
    text-decoration: underline;
}

/* Stili per le pagine informative (termini-e-condizioni.html, guida.html) */
.info-section {
    background: #ffffff;
    padding: 1.5em;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-top: 2em;
    text-align: left; /* Il testo delle info section è allineato a sinistra per leggibilità */
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.info-section h2 {
    color: #6EC1E4;
    text-align: center;
    margin-top: 0;
    margin-bottom: 1em;
    font-size: 1.8em;
}

.info-section h3 {
    color: #4CAF50;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-size: 1.4em;
}

.info-section p {
    font-size: 1em;
    line-height: 1.6;
    margin-bottom: 1em;
}

/* Media Queries per la Responsività su Schermi più Piccoli */
@media (max-width: 600px) {
    body {
        padding: 0.5em;
    }

    header {
        padding: 0.8em;
    }

    h1 {
        font-size: 1.8em;
    }

    #emotion-wheel .emotion {
        width: 60px;
        height: 60px;
        font-size: 2.8em;
    }

    #log-feedback, #text-mood-entry, #navigation-buttons-section, #manage-emotions-section, #mood-history, .info-section {
        padding: 1em;
        margin-top: 1.5em;
    }
    
    #text-mood-input {
        width: 100%;
    }

    #navigation-buttons-section {
        flex-direction: column;
        gap: 1em;
        padding: 0.5em;
    }

    .app-nav-button {
        width: calc(100% - 2em);
        padding: 0.8em 1em;
    }

    .calm-button {
        width: calc(100% - 2em);
        padding: 0.8em 1em;
    }

    .history-item-base {
        font-size: 1em;
        padding: 0.6em 0.8em;
    }
    
    .history-item .emotion-display {
        font-size: 1.6em;
    }

    .date-indicator-emojis {
        font-size: 2.2em;
        margin-left: 5px;
    }

    .add-emotion-form {
        flex-direction: column;
    }
    .add-emotion-form input[type="text"],
    .add-emotion-form button {
        width: 100%;
        margin-bottom: 10px;
    }
    .add-emotion-form button:last-child {
        margin-bottom: 0;
    }

    footer {
        padding: 1em 0.5em;
        margin-top: 2em;
    }
}