.events-timeline-container {
    position: relative;
    max-height: 70vh;
    height: auto;
    overflow-y: auto;
    padding-right: 15px;
}

.event-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.event-search-wrapper {
    margin-top: 14px;
    max-width: 850px;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    justify-content: center;
}

.event-search {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: var(--white);
    border: 1px solid rgba(57, 136, 141, 0.25);
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.event-search:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 10px 24px rgba(57, 136, 141, 0.12);
}

.event-search input {
    flex: 1 1 auto;
    border: none;
    box-shadow: none;
    outline: none;
    font-size: 0.95rem;
    color: var(--dark);
    padding-left: 4px;
}

.event-search input::placeholder {
    color: #8a8f9c;
}

.event-search .search-icon {
    color: var(--primary-color);
    font-size: 1rem;
}

.event-search .clear-search {
    border: none;
    background: rgba(57, 136, 141, 0.12);
    color: var(--dark);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.event-search .clear-search:hover {
    background: rgba(57, 136, 141, 0.2);
    transform: translateY(-1px);
}

.no-events-message {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    margin-top: 10px;
    border-radius: 12px;
    border: 1px dashed rgba(57, 136, 141, 0.35);
    background: rgba(57, 136, 141, 0.06);
    color: var(--dark);
    font-weight: 600;
}

.events-timeline {
    position: relative;
    padding: 20px 0;
}

.events-timeline::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-color), var(--dark-accent));
    border-radius: 3px;
}

.timeline-event {
    position: relative;
    margin-bottom: 30px;
    padding-left: 70px;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInRight 0.6s ease forwards;
}

.timeline-event:nth-child(even) {
    animation-delay: 0.1s;
}

.timeline-event {
    transition: transform 0.2s ease, filter 0.2s ease;
}

.timeline-event.active {
    background: linear-gradient(120deg, rgba(57, 136, 141, 0.12), rgba(243, 159, 126, 0.12));
    border-radius: 14px;
    padding: 16px 16px 18px 70px;
    margin-left: 0;
    border-left: 4px solid var(--secondary-color);
    filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.12));
}

.timeline-event-marker {
    position: absolute;
    left: 20px;
    top: 0;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: var(--white);
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 0 3px rgba(57, 136, 141, 0.1);
    z-index: 2;
    transition: all 0.3s ease;
}

.timeline-event.active .timeline-event-marker {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: scale(1.2);
}

.timeline-event-year {
    position: absolute;
    left: -70px;
    top: 0;
    background: var(--primary-color);
    color: var(--white);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 60px;
    text-align: center;
}

.timeline-event-content {
    background: var(--white);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(57, 136, 141, 0.1);
}

.timeline-event:hover .timeline-event-content {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--light-accent);
}

.timeline-event.active .timeline-event-content {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
    border-color: var(--secondary-color);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.event-title {
    color: var(--primary-color);
    font-weight: 700;
    margin: 0;
    font-size: 1.2rem;
    flex: 1;
}

.timeline-event.active .event-title {
    color: var(--dark-accent);
}

.event-category-badge {
    background: var(--light-accent);
    color: var(--dark);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 10px;
    white-space: nowrap;
}

.timeline-event.active .event-category-badge {
    background: var(--secondary-color);
    color: var(--white);
    box-shadow: 0 8px 20px rgba(243, 159, 126, 0.35);
}

.event-date-location {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #666;
}

.event-date-location i {
    color: var(--dark-accent);
}

.event-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.9rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.timeline-event.active .event-description {
    -webkit-line-clamp: unset;
}

.event-result {
    background: linear-gradient(45deg, rgba(241, 185, 140, 0.1), rgba(243, 159, 126, 0.1));
    border-left: 3px solid var(--secondary-color);
    padding: 10px 15px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
}

.event-result strong {
    color: var(--dark-accent);
    font-weight: 700;
}

.event-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.link-select {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    outline: none;
}

.link-select:focus {
    border-color: var(--dark-accent);
}

.btn-more-info {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.btn-more-info:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-select-event {
    background: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.btn-select-event:hover {
    background: var(--dark-accent);
    transform: translateY(-2px);
}

/* Mappa Stili */
.event-map-container {
    background: var(--white);
    border-radius: 15px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    min-height: 55vh;
    height: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.map-header {
    margin-bottom: 6px;
    text-align: center;
}

.map-header h4 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 5px;
}

#italy-map-container {
    flex: 1 1 auto;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
    position: relative;
    /* min-height: 480px; */
}

#italy-map {
    width: 100%;
    height: 100%;
    display: block;
}

.map-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 15px 0;
}

.map-controls .btn {
    padding: 5px 15px;
    font-size: 0.8rem;
}

.selected-event-info {
    background: rgba(57, 136, 141, 0.05);
    border-radius: 10px;
    padding: 15px;
    margin-top: 15px;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selected-event-info .event-details {
    text-align: center;
}

.selected-event-info h5 {
    color: var(--primary-color);
    margin-bottom: 5px;
    font-weight: 700;
}

.selected-event-info p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Statistiche Eventi */
.event-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.stat-card {
    background: var(--white);
    border-radius: 15px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    border-color: var(--light-accent);
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, var(--primary-color), var(--dark-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.stat-icon i {
    font-size: 1.5rem;
    color: var(--white);
}

.stat-content h3 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(45deg, var(--primary-color), var(--dark-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 5px;
    line-height: 1;
}

.stat-content p {
    color: #666;
    font-weight: 600;
    font-size: 0.9rem;
    margin: 0;
}

/* Animazioni */
@keyframes slideInRight {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive */
@media (max-width: 992px) {
    .events-timeline-container {
        max-height: 60vh;
        height: auto;
    }
    
    .event-map-container {
        min-height: 45vh;
        height: auto;
        margin-top: 30px;
    }
    
    .event-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .events-timeline-container {
        max-height: 50vh;
        height: auto;
    }
    
    .timeline-event {
        padding-left: 60px;
    }
    
    .timeline-event::before {
        left: 20px;
    }
    
    .timeline-event-year {
        left: -55px;
        min-width: 50px;
    }
    
    .event-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .event-category-badge {
        align-self: flex-start;
        margin-left: 0;
    }
    
    .event-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .events-timeline-container {
        max-height: 50vh;
        height: auto;
        padding-right: 10px;
    }
    
    .timeline-event-content {
        padding: 15px;
    }
    
    .event-actions {
        flex-direction: column;
    }
    
    .btn-more-info,
    .btn-select-event,
    .link-select {
        width: 100%;
        text-align: center;
    }
}