:root {
    --bg-dark: #1A4365;
    --bg-card: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --text-light: #94A3B8;
    --accent-orange: #F97316;
    --accent-blue: #2563EB;
    --accent-teal: #0D9488;
    --accent-gold: #D97706;
    --accent-red: #EF4444;
    --tab-inactive: rgba(255, 255, 255, 0.15);
    --tab-active: #FFFFFF;
    --live-bg: #FFF7ED;
    --radius-lg: 20px;
    --radius-md: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

.app-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-dark);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* Banner Pausa */
.pause-banner {
    background: var(--accent-red);
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    animation: pulse-red 2s infinite;
    z-index: 10;
}

/* Header */
.hero-section { padding: 30px 20px 20px; color: white; flex-shrink: 0; animation: fadeInDown 0.6s ease-out; }
.event-overline { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.9; }
.event-title { font-size: 2.2rem; font-weight: 800; margin: 5px 0 10px; letter-spacing: -0.02em; }
.event-date, .event-location { font-size: 0.95rem; color: #CBD5E1; margin-bottom: 4px; }
.map-btn { margin-top: 15px; background: rgba(255, 255, 255, 0.15); color: white; border: none; padding: 10px 16px; border-radius: 20px; font-family: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer; transition: background 0.2s; }
.map-btn:active { background: rgba(255, 255, 255, 0.25); transform: scale(0.98); }
.handouts-btn { margin-left: 8px; }
.handouts-list { list-style: none; margin-top: 8px; }
.handouts-list li { margin-top: 6px; }
.handouts-list a { color: white; font-size: 0.85rem; overflow-wrap: anywhere; }
.payment-status { margin: 0 20px 15px; padding: 12px 16px; border-radius: 12px; background: #DCFCE7; color: #166534; font-size: 0.9rem; font-weight: 600; }
.payment-status[hidden] { display: none; }

.mp3-dialog { width: min(420px, calc(100% - 32px)); margin: auto; padding: 0; border: 0; border-radius: 18px; color: var(--text-main); box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.mp3-dialog::backdrop { background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(3px); }
.mp3-dialog form { position: relative; padding: 28px 24px 24px; }
.mp3-dialog h2 { margin: 0 28px 14px 0; font-size: 1.4rem; }
.mp3-dialog form > p { margin: 10px 0; line-height: 1.45; }
.dialog-close { position: absolute; top: 12px; right: 14px; width: 34px; height: 34px; border: 0; border-radius: 50%; background: #F1F5F9; color: var(--text-main); font-size: 1.5rem; cursor: pointer; }
.transcription-option { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; padding: 14px; border: 1px solid #CBD5E1; border-radius: 12px; cursor: pointer; font-size: 0.9rem; line-height: 1.4; }
.transcription-option input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent-blue); }
.checkout-total { padding-top: 12px; border-top: 1px solid #E2E8F0; font-size: 1.1rem; }
.checkout-error { color: #B91C1C; font-size: 0.85rem; }
.checkout-submit { width: 100%; margin-top: 10px; padding: 13px 16px; border: 0; border-radius: 12px; background: var(--accent-blue); color: white; font: inherit; font-weight: 700; cursor: pointer; }
.checkout-submit:disabled { opacity: 0.6; cursor: wait; }

/* Tabs Giorni */
.day-tabs { display: flex; gap: 10px; padding: 0 20px 20px; flex-shrink: 0; }
.day-tab { flex: 1; background: var(--tab-inactive); border-radius: var(--radius-md); padding: 12px 0; text-align: center; color: white; cursor: pointer; transition: all 0.3s ease; border: 2px solid transparent; }
.day-tab .day-name { display: block; font-size: 0.85rem; color: #CBD5E1; margin-bottom: 4px; }
.day-tab .day-number { display: block; font-size: 1.4rem; font-weight: 700; }
.day-tab.active { background: var(--tab-active); color: var(--text-main); box-shadow: var(--shadow-md); }
.day-tab.active .day-name { color: var(--text-muted); }
.day-tab.active .today-label { display: block; font-size: 0.7rem; color: var(--accent-orange); font-weight: 700; margin-top: 2px; text-transform: uppercase; }

/* Lista Programma */
.schedule-container {
    margin-right: 20px;
    flex: 1;
    background: #F8FAFC;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px 15px;
    /* overflow-y: auto; */
    /* overflow-x: hidden; */
    margin-left: 20px;
    position: relative;
    animation: slideUp 0.5s ease-out;
}
.schedule-container::-webkit-scrollbar { width: 6px; }
.schedule-container::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }

/* Item della timeline */
.timeline-item { display: flex; margin-bottom: 12px; position: relative; opacity: 0; transform: translateY(10px); animation: fadeInUp 0.4s ease-out forwards; }
.time-col { width: 60px; flex-shrink: 0; font-size: 0.9rem; font-weight: 600; color: var(--text-muted); padding-top: 15px; }
.time-col .end-time { display: block; font-size: 0.75rem; color: var(--text-light); font-weight: 400; }
.content-col { flex: 1; background: var(--bg-card); border-radius: var(--radius-md); padding: 15px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; transition: transform 0.2s; }
.content-col::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 5px 0 0 5px; }

.timeline-item[data-color="blue"] .content-col::before { background: var(--accent-blue); }
.timeline-item[data-color="orange"] .content-col::before { background: var(--accent-orange); }
.timeline-item[data-color="teal"] .content-col::before { background: var(--accent-teal); }
.timeline-item[data-color="gold"] .content-col::before { background: var(--accent-gold); }

/* Stato Live */
.timeline-item.live { background: var(--live-bg); border-radius: var(--radius-md); }
.timeline-item.live .content-col { background: transparent; box-shadow: none; }
.timeline-item.live .content-col::before { background: var(--accent-orange); }
.timeline-item.paused .content-col::before { background: var(--accent-red); }

.item-header { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; flex-wrap: wrap; }
.item-title { font-size: 1.1rem; font-weight: 700; color: var(--text-main); }
.badge { font-size: 0.65rem; font-weight: 700; padding: 3px 8px; border-radius: 20px; text-transform: uppercase; color: white; letter-spacing: 0.05em; }
.badge.in-corso { background: var(--accent-orange); animation: pulse 2s infinite; }
.badge.prossimo { background: var(--accent-blue); }
.badge.paused { background: var(--accent-red); animation: pulse-red 2s infinite; }

.item-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; margin-bottom: 8px; }
.map-link { display: inline-flex; align-items: center; gap: 5px; background: #F1F5F9; padding: 4px 10px; border-radius: 12px; font-size: 0.75rem; color: var(--text-muted); text-decoration: none; font-weight: 500; }
.map-link .pin { display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; background: var(--bg-dark); color: white; border-radius: 50%; font-size: 0.6rem; }

/* Animazioni */
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.4); } 70% { box-shadow: 0 0 0 6px rgba(249, 115, 22, 0); } 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); } }
@keyframes pulse-red { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); } 70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }