:root {
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Dark Theme Variables */
    --bg-body: #000;
    --bg-kiosk: #1a1a1a;
    --bg-overlay: rgba(0, 0, 0, 0.6);
    --bg-grid: #343434;
    --text-white: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.4);
    --footer-bg: rgba(30, 30, 30, 0.8);
    --bg-card-glass: rgba(40, 40, 40, 0.4);
}

body.light-mode {
    --bg-body: #f0f2f5;
    --bg-kiosk: #ffffff;
    --bg-overlay: rgba(255, 255, 255, 0.1);
    /* Reduced darkness for light mode */
    --bg-grid: #e2e8f0;
    --text-white: #1a1d21;
    --text-muted: rgba(0, 0, 0, 0.5);
    --footer-bg: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(0, 0, 0, 0.1);
    --bg-card-glass: rgba(255, 255, 255, 0.7);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-body);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* --- CONTENITORE DISPOSITIVO --- */
.kiosk-container {
    width: 100vw;
    height: 100vh;
    /*max-width: 1200px; 
    max-height: 800px; */
    /* Immagine di fallback o background generico */
    background-color: var(--bg-kiosk);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
    border: 14px solid #111;
    border-radius: 36px;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 40% 1fr;
    grid-template-rows: 1fr auto;
    grid-template-areas:
        "hero menu"
        "hero footer";
}

/* Overlay scuro globale */
.kiosk-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    backdrop-filter: blur(5px);
    z-index: 0;
}

/* --- MEDIA QUERY MOBILE --- */
@media (max-width: 768px) {
    .kiosk-container {
        max-width: 100%;
        max-height: 100%;
        border: none;
        border-radius: 0;
        grid-template-columns: 1fr;
        grid-template-rows: 35% 1fr auto;
        grid-template-areas: "hero" "menu" "footer";
    }

    .slider-section {
        border-right: none !important;
        border-bottom: 1px solid var(--glass-border);
    }
}

/* --- SEZIONE SLIDER (HERO) --- */
.slider-section {
    grid-area: hero;
    position: relative;
    z-index: 1;
    overflow: hidden;
    border-right: 1px solid var(--glass-border);
}

.slider-container {
    height: 100%;
    width: 100%;
    position: relative;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
}

.slide.active {
    opacity: 1;
    z-index: 2;
}

.slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent 60%);
    z-index: 1;
}

.slide-content {
    position: relative;
    z-index: 2;
    color: white;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.8s ease-out 0.3s, opacity 0.8s ease-out 0.3s;
}

.slide.active .slide-content {
    transform: translateY(0);
    opacity: 1;
}

.slide-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.slide-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 25px;
}

.slider-indicators {
    position: absolute;
    bottom: 25px;
    right: 30px;
    z-index: 10;
    display: flex;
    gap: 10px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s;
}

.indicator.active {
    background: white;
    transform: scale(1.2);
    width: 25px;
    border-radius: 5px;
}

.btn-cta {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: white;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-cta:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* --- GRIGLIA MENU --- */
.grid-menu {
    grid-area: menu;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: dense;
    grid-auto-rows: minmax(165px, 1fr);
    gap: 16px;
    z-index: 1;
    background: var(--bg-grid);
    overflow-y: auto;
}

/* --- TESSERE (GLASS CARDS) --- */
.menu-item {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px;
    text-decoration: none;
    background: linear-gradient(var(--bg-color, transparent), var(--bg-color, transparent)), var(--bg-card-glass);
    backdrop-filter: blur(25px) saturate(150%);
    -webkit-backdrop-filter: blur(25px) saturate(150%);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* WIDGET METEO SPECIALE */
.menu-item:nth-child(1) {
    grid-row: span 2;
}

.menu-item:nth-child(1) .icon-container {
    width: 100px;
    height: 100px;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.15);
}

.menu-item:nth-child(1) i {
    font-size: 3.5rem;
}

.menu-item:hover {
    transform: translateY(-4px);
    filter: brightness(1.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.menu-item:active {
    transform: scale(0.98);
}

.icon-container {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.menu-item i {
    font-size: 1.4rem;
    color: var(--text-white);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.menu-item span {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    align-self: flex-end;
    text-align: right;
    width: 100%;
}

/* --- STILI TESTO METEO & BIG STATS --- */
#meteo-temp {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--text-white);
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    margin-bottom: 5px;
}

#meteo-desc {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
    text-transform: capitalize;
}

.big-stat-text {
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-white);
    line-height: 1;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    align-self: flex-end;
    text-align: right;
    width: 100%;
}

.big-stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: right;
    align-self: flex-end;
}

/* Footer */
footer {
    grid-area: footer;
    z-index: 1;
    background: var(--footer-bg);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
    padding: 15px;
    text-align: center;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}