/* ======================================================================== */
/* 1. DEFINIZIONE DELLE VARIABILI DI TEMA (TEMA CHIARO)
/* ======================================================================== */
:root {
    --background-color: #f0f4f8;
    --header-bg: #ffffff;
    --text-dark: #1c2a48;
    --text-light: #4a5a78;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    --news-icon: #4361EE; /* Blu di default */
}

/* ======================================================================== */
/* 2. REGOLE CSS STRUTTURALI
/* ======================================================================== */
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.6s ease;
}
.totem-container {
    width: 80%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    padding: 20px;
    padding-bottom: 120px; /* Spazio per il ticker */
    margin: 0 auto;
    flex: 1;
}
.totem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--header-bg);
    padding: 5px 30px;
    border-radius: 30px;
    box-shadow: var(--shadow);
    transition: background-color 0.6s ease, box-shadow 0.6s ease;
}
.logo img {
    max-height: 100px;
    transition: filter 0.6s ease;
}
.datetime {
    text-align: right;
    color: var(--text-dark);
    transition: color 0.6s ease;
}
#currentTime {
    font-size: 32px;
    line-height: 40px;
    font-weight: 700;
}
#currentDay {
    font-size: 20px;
    line-height: 28px;
    font-weight: 400;
    color: var(--text-light);
    transition: color 0.6s ease;
}
.central-title h1 {
    color: var(--text-dark);
    transition: color 0.6s ease;
}
.central-title p {
    color: var(--text-light);
    transition: color 0.6s ease;
}
.events-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.card-evento {
    display: flex;
    align-items: stretch;
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
    color: white; /* Testo bianco fisso, come da richiesta (non toccare colori aule) */
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
    /* Il background è applicato inline da JS, non qui */
}
.icon-section {
    flex: 0 0 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}
.icon-section .material-icons {
    font-size: 36px;
}
.content-section {
    padding: 20px 25px;
    flex-grow: 1;
}
.content-section h3 {
    margin: 0 0 5px 0;
    font-size: 1.6rem;
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}
.content-section p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 400;
    opacity: 0.9;
}
.no-events-card {
    background: var(--header-bg); /* Usa il colore della superficie */
    color: var(--text-light);
    text-align: center;
    font-size: 1.2rem;
    padding: 40px;
    transition: background-color 0.6s ease, color 0.6s ease;
}
.news-ticker {
    padding: 15px 0;
    overflow: hidden;
    white-space: nowrap;
    background-color: var(--header-bg);
    box-shadow: var(--shadow);
    width: 100%;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transition: background-color 0.6s ease, box-shadow 0.6s ease;
}
.news-wrapper {
    display: inline-flex;
    gap: 25px;
}
.news-card {
    width: 450px;
    background-color: var(--header-bg); /* Diverso da --news-ticker bg in alcuni temi */
    box-shadow: var(--shadow);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text-dark);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out, background-color 0.6s ease, color 0.6s ease;
    white-space: normal;
    display: flex;
    align-items: center;
    padding: 20px;
}
.news-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}
.news-icon-container {
    flex-shrink: 0;
    margin-right: 20px;
}
.news-icon-container .material-icons {
    font-size: 48px;
    color: var(--news-icon); /* Colore icona news variabile */
    transition: color 0.6s ease;
}
.news-title-container {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

/* Animazioni */
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
@keyframes scroll-news {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}
.news-wrapper:hover { animation-play-state: paused; }


/* ======================================================================== */
/* 3. DEFINIZIONE TEMI (Scuro e Halloween)
/* ======================================================================== */

/* --- TEMA SCURO --- */
body.dark-mode {
    --background-color: #141414;
    --header-bg: #202020;
    --text-dark: #ffffff;
    --text-light: #bbbbbb;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    --news-icon: #4895EF; /* Blu più chiaro per contrasto */
}
/* Scurisci il logo blu di default in dark mode (LogoBianco.png è già bianco) */
body.dark-mode .logo img[src$="Logo.png"] {
    filter: brightness(0.8);
}

/* --- TEMA HALLOWEEN --- */
body.halloween-mode {
    --background-color: #221e22; /* Raisin Black */
    --header-bg: #31263e; /* Dark Purple */
    --text-dark: #eca72c; /* Hunyadi Yellow */
    --text-light: #ee5622; /* Flame */
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    --news-icon: #ee5622; /* Flame */
}
/* Nascondi l'icona "today" blu che stona */
body.halloween-mode .central-title .material-icons {
    display: none;
}