:root {
    --bg-light: #f8f9fa;
    --card-light: #ffffff;
    --accent-light: #f1f3f5;
    --primary: #495057;
    --secondary: #6c757d;
    --accent: #adb5bd;
    --text-dark: #212529;
    --text-muted: #6c757d;
    --border-light: #e9ecef;
    --highlight: #e9ecef;
    --timeline-line: #dee2e6;
    --year-header-bg: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    --year-header-hover: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

body {
    background-color: var(--bg-light);
    color: var(--text-dark);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

/* CORREZIONI PER TIMELINE PERFETTAMENTE ALLINEATA */

.year-container {
    margin-bottom: 2.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.year-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.year-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    letter-spacing: 0.5px;
}

/* CONTENITORE EVENTI */
.events-container {
    padding: 0 2rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.events-container.open {
    max-height: 5000px;
    padding: 1.5rem 2rem;
}

/* SINGOLO EVENTO */
.event {
    position: relative;
    padding: 1.5rem 0 1.5rem 100px;
    margin-bottom: 1.5rem;
    border-bottom: 1px dashed #e0e0e0;
}

.event:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* DATA EVENTO */
.event-date {
    position: absolute;
    left: 0;
    top: 1.5rem;
    width: 80px;
    padding: 0.4rem 0.8rem;
    background: #3498db;
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 3px 10px rgba(52,152,219,0.3);
}

/* ICONA EVENTO */
.event-icon {
    position: absolute;
    left: 90px;
    top: 1.5rem;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    color: #3498db;
    font-size: 0.9rem;
}

/* CONTENUTO EVENTO */
.event-content {
    padding-left: 1rem;
}

.event-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #2c3e50;
    font-weight: 500;
}

.event-content p {
    margin: 0;
    color: #7f8c8d;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* FRECCIA TOGGLE */
.toggle-icon {
    transition: transform 0.3s ease;
    color: #7f8c8d;
}

.timeline-container {
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.timeline-header {
    text-align: center;
    margin-bottom: 4rem;
}

.timeline-header h1 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.timeline-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Nuovo stile per i contenitori annuali */
.year-container {
    margin-bottom: 2rem;
    background: var(--card-light);
    border-radius: 10px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.year-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    cursor: pointer;
    background: var(--year-header-bg);
    transition: all 0.3s ease;
}

.year-header:hover {
    background: var(--year-header-hover);
}

.year-header h2 {
    margin: 0;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 500;
}

.toggle-icon {
    transition: transform 0.3s ease;
    color: var(--primary);
}

.toggle-icon i {
    font-size: 1.2rem;
}

/* Contenuto espandibile */
.events-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-in-out;
    padding: 0 2rem;
}

.events-container.open {
    max-height: 5000px;
    /* Valore sufficientemente grande */
    padding: 1rem 2rem 2rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50px;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent 0%, var(--accent) 10%, var(--accent) 90%, transparent 100%);
    transform: translateX(-50%);
}

/* Eventi */
.event {
    position: relative;
    margin-left: 40px;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease-out;
    padding-left: 80px;
}

.event.visible {
    opacity: 1;
    transform: translateY(0);
}

.event-content {
    width: 100%;
    padding: 1.5rem;
    background: var(--card-light);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: relative;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.event-content:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

.event-date {
    position: absolute;
    left: -70px;
    top: 20px;
    width: 120px;
    background: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: white;
    z-index: 4;
    text-align: center;
    font-size: 0.85rem;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-weight: 500;
}

.event-icon {
    position: absolute;
    left: 40px;
    top: 20px;
    width: 40px;
    height: 40px;
    background: var(--card-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    z-index: 3;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.event-content h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--primary);
    font-size: 1.2rem;
}

.event-content p {
    margin-bottom: 0;
    color: var(--text-dark);
    line-height: 1.6;
}
