/* Reset e Stili Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: rgb(30, 60, 114);
    --secondary-blue: rgb(40, 75, 130);
    --light-blue: rgb(220, 230, 245);
    --dark-blue: rgb(20, 45, 85);
    --white: #ffffff;
    --light-gray: #f8fafc;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --accent-blue: rgb(50, 85, 140);
    --shadow: 0 10px 25px rgba(30, 60, 114, 0.1);
    --shadow-hover: 0 20px 40px rgba(30, 60, 114, 0.15);
}

/* Font loading optimization per evitare FOUC - rimossa regola @font-face errata */
/* Google Fonts viene caricato tramite link nell'HTML */

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    overflow-x: hidden;
}

/* Animazioni Globali */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) scale(1.2);
        opacity: 0.7;
    }
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Animazioni Timeline Motorsport */
@keyframes timelineAppear {
    from {
        opacity: 0;
        height: 0;
    }
    to {
        opacity: 1;
        height: calc(100% - 80px);
    }
}

@keyframes timelineItemAppear {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes progressIndicator {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-5px) scale(1.1);
        opacity: 0.8;
    }
}

/* Nuove animazioni ottimizzate per timeline */
@keyframes championshipGlow {
    0% {
        box-shadow: 0 4px 15px rgba(30, 64, 175, 0.4);
    }
    100% {
        box-shadow: 0 6px 25px rgba(30, 64, 175, 0.6), 0 0 20px rgba(30, 64, 175, 0.3);
    }
}

/* Nuove animazioni ottimizzate per timeline */
@keyframes championshipGlowOrange {
    0% {
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
    }
    100% {
        box-shadow: 0 6px 25px rgba(255, 107, 53, 0.6), 0 0 20px rgba(247, 147, 30, 0.3);
    }
}

@keyframes timelineProgress {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes pulseRacing {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateX(-50%) scale(1.05);
        opacity: 0.9;
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-100px) rotateY(-15deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotateY(0deg);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(100px) rotateY(15deg);
    }
    to {
        opacity: 1;
        transform: translateX(0) rotateY(0deg);
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Animazione per lazy loading */
@keyframes lazyLoad {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes continue {
    from {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateY(-10px) scale(1.2);
        opacity: 0.7;
    }
}


@keyframes racingLine {
    from {
        height: 0;
        opacity: 0;
    }
    to {
        height: 100%;
        opacity: 1;
    }
}

@keyframes championshipGlow {
    from {
        box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
    }
    to {
        box-shadow: 0 8px 25px rgba(30, 64, 175, 0.6), 0 0 15px rgba(30, 64, 175, 0.4);
    }
}

@keyframes raceStripe {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(300%);
    }
}

/* Performance optimizations - già definite sotto */

/* Riduce animazioni su dispositivi con preferenze ridotte */
@media (prefers-reduced-motion: reduce) {
    .timeline-item,
    .timeline-year,
    .timeline-content,
    .bio-timeline::before,
    .bio-timeline::after {
        animation: none !important;
        transition: none !important;
    }
    
    .timeline-item {
        opacity: 1;
        transform: none;
    }
    
    .bio-timeline::before {
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-15px);
    }
    60% {
        transform: translateY(-8px);
    }
}

/* Nuove animazioni per la sezione hero */
@keyframes titleGlow {
    0% {
        text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 255, 255, 0.3);
    }
    100% {
        text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 40px rgba(255, 255, 255, 0.5), 0 0 60px rgba(255, 255, 255, 0.2);
    }
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes subtitlePulse {
    0%, 100% {
        opacity: 0.9;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.02);
    }
}

@keyframes achievementFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes numberGlow {
    0% {
        filter: brightness(1);
    }
    100% {
        filter: brightness(1.2) drop-shadow(0 0 10px rgba(30, 64, 175, 0.5));
    }
}



/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header e Navigazione */
.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-bottom: 2px solid rgba(30, 64, 175, 0.1);
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.1);
}

.navbar:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 8px 30px rgba(30, 64, 175, 0.15);
    border-bottom: 2px solid rgba(30, 64, 175, 0.2);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-blue);
    letter-spacing: -0.5px;
    animation: slideInLeft 0.8s ease-out;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    animation: fadeInScale 0.8s ease-out;
}

.nav-link {
    color: var(--primary-blue);
    text-decoration: none;
    font-weight: 600;
    padding: 0.8rem 1.8rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
    display: block;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50px;
    z-index: -1;
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link:hover {
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
    transform: translateY(-1px);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: var(--primary-blue);
    border-radius: 50%;
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1rem;
    animation: slideInRight 0.8s ease-out;
}

/* Nascondi le bandierine mobile su desktop */
.mobile-language-switcher {
    display: none;
}

.lang-btn {
    background: none;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.lang-btn:hover {
    opacity: 1;
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.2);
}

.lang-btn.active {
    opacity: 1;
    border-color: var(--primary-blue);
    background: rgba(30, 60, 114, 0.1);
}

.lang-btn svg {
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.lang-btn:hover svg {
    transform: scale(1.1);
}

/* Mobile Menu */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--primary-blue);
    margin: 3px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 2px;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgb(30, 60, 114) 0%, rgb(40, 75, 130) 50%, rgb(50, 85, 140) 100%);
    color: var(--white);
    padding: 8rem 0 4rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

/* Nuovo stile per hero-background con immagine trasparente che evita il menu */
.hero-background {
    position: absolute;
    top: 80px; /* Spazio per il menu */
    left: 0;
    width: 100%;
    height: calc(100% - 80px); /* Altezza ridotta per compensare il top */
    background-image: url('images/home-page.jpg');
    background-size: cover;
    background-position: top center; /* Allineata in alto del contenitore */
    background-repeat: no-repeat;
    opacity: 0.15; /* Trasparenza per non coprire il gradiente blu */
    z-index: 1;
    transition: opacity 0.3s ease;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="grid" width="50" height="50" patternUnits="userSpaceOnUse"><path d="M 50 0 L 0 0 0 50" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    animation: float 6s ease-in-out infinite;
}



.hero .container {
    position: relative;
    z-index: 2;
}

.hero-content {
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

/* Titolo principale con effetto typewriter e glow */
.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 255, 255, 0.3);
    animation: titleGlow 3s ease-in-out infinite alternate, fadeInUp 1s ease-out 0.2s both;
    position: relative;
    overflow: hidden;
}

.hero-content h1::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s ease-in-out 1s;
}

/* Sottotitolo con effetto pulse */
.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.4s both, subtitlePulse 4s ease-in-out infinite;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Sezione achievements con animazioni staggered */
.hero-achievements {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.achievement-item {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 1.5rem 2rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: achievementFloat 3s ease-in-out infinite;
}

.achievement-item:nth-child(1) {
    animation-delay: 0s;
}

.achievement-item:nth-child(2) {
    animation-delay: 0.5s;
}

.achievement-item:nth-child(3) {
    animation-delay: 1s;
}

.achievement-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.achievement-item:hover::before {
    left: 100%;
}

.achievement-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.achievement-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b35, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    animation: numberGlow 2s ease-in-out infinite alternate;
}

.achievement-text {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.8;
    line-height: 1.8;
    animation: fadeInUp 1s ease-out 0.8s both;
}

.cta-button {
    display: inline-block;
    background: var(--white);
    color: var(--primary-blue);
    padding: 1.2rem 2.5rem;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 1s ease-out 0.8s both;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    background: #f1f5f9;
}

/* Sezione Highlights (Carriera in numeri) - PALLINI RADDOPPIATI E DISTANZE CORRETTE */
.highlights {
    background: linear-gradient(135deg, rgb(30, 60, 114) 0%, rgb(20, 45, 85) 100%);
    padding: 3rem 0;
    position: relative;
    overflow: hidden;
}

.highlights::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8000 4000"><defs><filter id="blur1"><feGaussianBlur stdDeviation="1.5"/></filter><filter id="blur2"><feGaussianBlur stdDeviation="2"/></filter><filter id="blur3"><feGaussianBlur stdDeviation="1"/></filter><filter id="blur4"><feGaussianBlur stdDeviation="1.8"/></filter><filter id="blur5"><feGaussianBlur stdDeviation="2.2"/></filter><filter id="blur6"><feGaussianBlur stdDeviation="1.3"/></filter><filter id="blur7"><feGaussianBlur stdDeviation="1.7"/></filter><filter id="blur8"><feGaussianBlur stdDeviation="2.1"/></filter><filter id="blur9"><feGaussianBlur stdDeviation="1.4"/></filter><filter id="blur10"><feGaussianBlur stdDeviation="1.9"/></filter><filter id="blur11"><feGaussianBlur stdDeviation="1.6"/></filter><filter id="blur12"><feGaussianBlur stdDeviation="2.3"/></filter></defs><circle cx="-1000" cy="400" r="30" fill="rgba(255,255,255,0.12)" filter="url(%23blur1)" style="filter:blur(1.5px)"><animateTransform attributeName="transform" type="translate" values="0,0; 18000,1200" dur="38s" repeatCount="indefinite"/><animate attributeName="r" values="30;60;45" dur="38s" repeatCount="indefinite"/></circle><circle cx="17000" cy="800" r="54" fill="rgba(255,255,255,0.08)" filter="url(%23blur2)" style="filter:blur(2px)"><animateTransform attributeName="transform" type="translate" values="0,0; -19000,-600" dur="40s" repeatCount="indefinite"/><animate attributeName="r" values="54;30;48" dur="40s" repeatCount="indefinite"/></circle><circle cx="4000" cy="-800" r="42" fill="rgba(255,255,255,0.15)" filter="url(%23blur3)" style="filter:blur(1px)"><animateTransform attributeName="transform" type="translate" values="0,0; -5000,5200" dur="22s" repeatCount="indefinite"/><animate attributeName="r" values="42;33;57" dur="22s" repeatCount="indefinite"/></circle><circle cx="3000" cy="4800" r="51" fill="rgba(255,255,255,0.09)" filter="url(%23blur4)" style="filter:blur(1.8px)"><animateTransform attributeName="transform" type="translate" values="0,0; 14000,-6000" dur="35s" repeatCount="indefinite"/><animate attributeName="r" values="51;39;60" dur="35s" repeatCount="indefinite"/></circle><circle cx="-1200" cy="1800" r="33" fill="rgba(255,255,255,0.11)" filter="url(%23blur5)" style="filter:blur(2.2px)"><animateTransform attributeName="transform" type="translate" values="0,0; 19500,-1350" dur="42s" repeatCount="indefinite"/><animate attributeName="r" values="33;57;30" dur="42s" repeatCount="indefinite"/></circle><circle cx="18500" cy="-600" r="48" fill="rgba(255,255,255,0.13)" filter="url(%23blur6)" style="filter:blur(1.3px)"><animateTransform attributeName="transform" type="translate" values="0,0; -20000,5000" dur="45s" repeatCount="indefinite"/><animate attributeName="r" values="48;36;54" dur="45s" repeatCount="indefinite"/></circle><circle cx="-800" cy="1200" r="39" fill="rgba(255,255,255,0.10)" filter="url(%23blur7)" style="filter:blur(1.7px)"><animateTransform attributeName="transform" type="translate" values="0,0; 17500,900" dur="37s" repeatCount="indefinite"/><animate attributeName="r" values="39;54;42" dur="37s" repeatCount="indefinite"/></circle><circle cx="16800" cy="3200" r="45" fill="rgba(255,255,255,0.14)" filter="url(%23blur8)" style="filter:blur(2.1px)"><animateTransform attributeName="transform" type="translate" values="0,0; -18500,-3800" dur="39s" repeatCount="indefinite"/><animate attributeName="r" values="45;33;51" dur="39s" repeatCount="indefinite"/></circle><circle cx="2000" cy="-400" r="57" fill="rgba(255,255,255,0.09)" filter="url(%23blur9)" style="filter:blur(1.4px)"><animateTransform attributeName="transform" type="translate" values="0,0; 15000,4800" dur="32s" repeatCount="indefinite"/><animate attributeName="r" values="57;36;60" dur="32s" repeatCount="indefinite"/></circle><circle cx="6000" cy="4600" r="30" fill="rgba(255,255,255,0.12)" filter="url(%23blur10)" style="filter:blur(1.9px)"><animateTransform attributeName="transform" type="translate" values="0,0; -7500,-5400" dur="25s" repeatCount="indefinite"/><animate attributeName="r" values="30;48;33" dur="25s" repeatCount="indefinite"/></circle><circle cx="-1000" cy="600" r="42" fill="rgba(255,255,255,0.11)" filter="url(%23blur11)" style="filter:blur(1.6px)"><animateTransform attributeName="transform" type="translate" values="0,0; 18500,2400" dur="41s" repeatCount="indefinite"/><animate attributeName="r" values="42;57;39" dur="41s" repeatCount="indefinite"/></circle><circle cx="17500" cy="1500" r="48" fill="rgba(255,255,255,0.13)" filter="url(%23blur12)" style="filter:blur(2.3px)"><animateTransform attributeName="transform" type="translate" values="0,0; -19000,-1600" dur="43s" repeatCount="indefinite"/><animate attributeName="r" values="48;30;54" dur="43s" repeatCount="indefinite"/></circle></svg>') no-repeat;
    background-size: 100% 100%;
    animation: backgroundFloat 30s ease-in-out infinite;
}

@keyframes backgroundFloat {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: scale(1.01) rotate(0.5deg);
        opacity: 0.95;
    }
}

.highlights .container {
    position: relative;
    z-index: 2;
}

.highlights h2 {
    text-align: center;
    font-size: 2.5rem;
    color: white;
    margin-bottom: 3rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: fadeInUp 1s ease-out;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 2.5rem 2rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    background: rgba(255, 255, 255, 0.15);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    animation: bounce 2s infinite;
}

.stat-card h3.counter {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b35, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1;
    transition: all 0.3s ease;
    text-shadow: none;
}



.stat-text {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b35, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1;
    text-shadow: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.stat-suffix {
    background: linear-gradient(135deg, #ff6b35, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2rem;
    font-weight: 600;
    margin-left: 0.2rem;
    text-shadow: none;
}

.stat-card p {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 1.1rem;
    margin-top: 0;
    text-shadow: 0 1px 5px rgba(0,0,0,0.3);
}

/* Animazione speciale per i contatori */
.counter {
    display: inline-block;
    transition: all 0.3s ease;
}

.counter.counting {
    color: #48dbfb;
    transform: scale(1.1);
}

/* Sezioni Pagina */
.page-section {
    padding: 5rem 0;
    position: relative;
}

.page-section:nth-child(even) {
    background: var(--white);
}

.page-section:nth-child(odd) {
    background: var(--light-gray);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s ease-out;
}

.section-header h1 {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

.section-header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 2px;
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Timeline Biografia con Micro-animazioni Ottimizzate */
.bio-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    scroll-behavior: smooth;
}

.bio-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-blue), var(--secondary-blue));
    transform: translateX(-50%);
    border-radius: 2px;
    opacity: 0;
    animation: timelineAppear 1.5s ease-out 0.3s forwards;
    will-change: opacity, height;
}

/* Disabilita le animazioni dopo il primo caricamento */
.bio-timeline.animation-completed::before {
    animation: none !important;
    opacity: 1;
    height: calc(100% - 80px);
}

.bio-timeline.animation-completed .timeline-item:nth-child(odd) .timeline-content {
    animation: none !important;
}

.bio-timeline.animation-completed .timeline-item:nth-child(even) .timeline-content {
    animation: none !important;
}

/* Permetti l'animazione highlightPulse quando highlighted */
.bio-timeline.animation-completed .timeline-item.highlighted .timeline-content {
    animation: highlightPulse 2s ease-in-out !important;
}

/* Indicatore di progresso timeline */
.bio-timeline::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    width: 6px;
    height: 0;
    max-height: calc(100% - 180px);
    background: linear-gradient(180deg, #ff6b35, #f7931e);
    transform: translateX(-50%);
    border-radius: 3px;
    z-index: 1;
    animation: timelineProgress 2s ease-out 1s forwards;
    will-change: height;
}

/* Indicatore di inizio timeline ottimizzato */
.bio-timeline .timeline-start {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: -8px;
    width: 16px;
    height: 16px;
    background: var(--primary-blue);
    border-radius: 50%;
    border: 3px solid var(--white);
    box-shadow: 0 2px 10px rgba(30, 60, 114, 0.3);
    z-index: 15;
    animation: pulseRacing 3s ease-in-out infinite;
}

.timeline-item {
    display: flex;
    margin-bottom: 3rem;
    position: relative;
    opacity: 0;
    transform: translateY(30px);
    animation: lazyLoad 0.8s ease-out forwards;
    will-change: opacity, transform;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Lazy loading con Intersection Observer */
.timeline-item.lazy-load {
    opacity: 0;
    transform: translateY(50px) scale(0.95);
}

.timeline-item.in-view {
    animation: lazyLoad 0.8s ease-out forwards;
}

/* Animazioni graduate più dolci */
.timeline-item:nth-child(1) { animation-delay: 0.1s; }
.timeline-item:nth-child(2) { animation-delay: 0.15s; }
.timeline-item:nth-child(3) { animation-delay: 0.2s; }
.timeline-item:nth-child(4) { animation-delay: 0.25s; }
.timeline-item:nth-child(5) { animation-delay: 0.3s; }
.timeline-item:nth-child(6) { animation-delay: 0.35s; }
.timeline-item:nth-child(n+7) { animation-delay: 0.4s; }

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-item:nth-child(even) {
    flex-direction: row;
}

/* Hover effect semplice per timeline items */
.timeline-item:hover {
    z-index: 10;
}

/* Ovali della timeline: BLU per eventi normali, ARANCIONE per vittorie */
.timeline-year {
    background: var(--primary-blue);
    color: var(--white);
    padding: 1rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.1rem;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    outline: none;
    border: 2px solid transparent;
    min-width: auto;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.timeline-year:focus-visible {
    outline: 3px solid #ff6b35;
    outline-offset: 3px;
    border-color: rgba(30, 64, 175, 0.3);
}

.timeline-year:focus {
    outline: 3px solid #ff6b35;
    outline-offset: 3px;
}

/* Racing stripes effect per timeline years */
.timeline-year::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

/* Hover BLU per eventi normali */
.timeline-item .timeline-year:hover {
    transform: translateX(-50%) scale(1.15);
    background: var(--secondary-blue);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.4);
}

/* Effetto racing stripes per tutti gli ovali */
.timeline-year:hover::before {
    left: 100%;
}

/* SOLO LE VITTORIE SONO ARANCIONI */
.timeline-item:nth-child(4) .timeline-year,
.timeline-item:nth-child(5) .timeline-year,
.timeline-item:nth-child(6) .timeline-year,
.timeline-item:nth-child(7) .timeline-year,
.timeline-item:nth-child(8) .timeline-year,
.timeline-item:nth-child(9) .timeline-year,
.timeline-item:nth-child(10) .timeline-year,
.timeline-item:nth-child(14) .timeline-year{
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4);
}



/* Animazione glow per le vittorie del karting */

.timeline-item:nth-child(2) .timeline-year,
.timeline-item:nth-child(3) .timeline-year,
.timeline-item:nth-child(11) .timeline-year,
.timeline-item:nth-child(12) .timeline-year,
.timeline-item:nth-child(13) .timeline-year,
.timeline-item:nth-child(15) .timeline-year {
    animation: championshipGlow 4s ease-in-out infinite alternate;
}

.timeline-item:nth-child(4) .timeline-year,
.timeline-item:nth-child(5) .timeline-year,
.timeline-item:nth-child(6) .timeline-year,
.timeline-item:nth-child(7) .timeline-year,
.timeline-item:nth-child(8) .timeline-year,
.timeline-item:nth-child(9) .timeline-year,
.timeline-item:nth-child(10) .timeline-year,
.timeline-item:nth-child(14) .timeline-year {
    animation: championshipGlowOrange 4s ease-in-out infinite alternate;
}


.timeline-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    width: calc(50% - 2rem);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(30, 64, 175, 0.1);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
    /* Accessibilità migliorata */
    outline: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    /* Micro-interazioni */
    transform-origin: center;
    will-change: transform, box-shadow;
}

.timeline-content:focus-visible {
    outline: none;
    border-color: rgba(30, 64, 175, 0.3);
}

.timeline-content:focus {
    outline: none;
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* Animazione di lettura progressiva */
.timeline-content.reading {
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    border-color: rgba(30, 64, 175, 0.2);
}

/* Barra arancione che si muove verso destra */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #f7931e);
    transition: width 0.4s ease;
}

/* Effetti di click - titolo e riga superiore arancioni */
.timeline-item.clicked .timeline-content h3 {
    color: #ff6b35 !important;
    transition: color 0.3s ease;
}

.timeline-item.clicked .timeline-content::before {
    width: 100% !important;
    transition: width 0.6s ease;
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: auto;
    animation: slideInRight 0.8s ease-out;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-right: auto;
    animation: slideInLeft 0.8s ease-out;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(30, 64, 175, 0.2);
}

.timeline-content:hover::before {
    width: 100%;
}

/* Semplici transizioni per testo */
.timeline-content h3 {
    transition: color 0.3s ease;
}

.timeline-content:hover h3 {
    color: #ff6b35;
}

.timeline-content p {
    line-height: 1.7;
}

/* Timeline dots per indicare eventi speciali */
.timeline-dots {
    text-align: center;
    padding: 2rem 0;
    position: relative;
}

.timeline-dots .dot {
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border-radius: 50%;
    display: inline-block;
    margin: 0 0.5rem;
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(30, 64, 175, 0.4);
}

.timeline-dots .dot:nth-child(2) {
    animation-delay: 0.5s;
}

.timeline-dots .dot:nth-child(3) {
    animation-delay: 1s;
}

/* Micro-interazioni avanzate */
.timeline-year:active {
    transform: translateX(-50%) scale(0.95);
    transition: transform 0.1s ease;
}

.timeline-content:active {
    transform: translateY(-5px) scale(0.98);
    transition: transform 0.1s ease;
}

/* Effetto di lettura completata */
.timeline-item.read .timeline-content {
    opacity: 0.8;
    transform: scale(0.98);
}



/* Indicatore di progresso di lettura */
.timeline-content .read-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6b35, #f7931e);
    width: 0;
    transition: width 0.3s ease;
}

.timeline-content.reading .read-progress {
    animation: timelineProgress 2s ease-out forwards;
}

/* Effetto highlight per navigazione da tastiera */
.timeline-item.highlighted {
    position: relative;
    z-index: 10;
}

.timeline-item.highlighted .timeline-content {
    background: linear-gradient(135deg, #fff5f0 0%, #fff 100%);
    border-color: rgba(30, 64, 175, 0.4);
    box-shadow: 0 10px 30px rgba(30, 64, 175, 0.2), 0 0 0 3px rgba(30, 64, 175, 0.1);
    animation: highlightPulse 2s ease-in-out;
}



@keyframes highlightPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes highlightGlow {
    0%, 100% {
        box-shadow: 0 6px 25px rgba(30, 64, 175, 0.4);
    }
    50% {
        box-shadow: 0 8px 35px rgba(30, 64, 175, 0.6), 0 0 25px rgba(30, 64, 175, 0.3);
    }
}

/* Stili per movimento ridotto - già definiti sopra */

/* Ottimizzazioni performance */
.timeline-item,
.timeline-year,
.timeline-content {
    contain: layout style;
}

.bio-timeline {
    contain: layout;
}

/* Stili per screen reader */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Risultati */
.championships {
    margin-bottom: 4rem;
}

.championships h2 {
    text-align: center;
    color: var(--primary-blue);
    margin-bottom: 2rem;
    font-size: 2rem;
    font-weight: 600;
}

.championship-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.championship-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(30, 64, 175, 0.1);
    animation: fadeInUp 0.8s ease-out;
}

.championship-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.championship-card h3 {
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.years {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.year {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.year:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.result-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(30, 64, 175, 0.1);
    animation: fadeInUp 0.8s ease-out;
}

.result-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.result-card h3 {
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.result-card ul {
    list-style: none;
}

.result-card li {
    padding: 0.5rem 0;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
}

.result-card li:hover {
    color: var(--primary-blue);
    transform: translateX(5px);
}

/* Tabelle */
.table-container {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: fadeInUp 0.8s ease-out;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th {
    background: var(--primary-blue);
    color: var(--white);
    padding: 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 1.1rem;
}

.results-table td {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid rgba(30, 64, 175, 0.1);
    transition: all 0.3s ease;
}

.results-table tr:hover {
    background: var(--light-blue);
    transform: scale(1.01);
}

.results-table tr.highlight {
    background: linear-gradient(135deg, var(--light-blue), rgba(59, 130, 246, 0.1));
    font-weight: 600;
}

/* Galleria */
.gallery-categories {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.category-btn {
    background: var(--white);
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-blue);
    transition: left 0.3s ease;
    z-index: -1;
}

.category-btn:hover::before,
.category-btn.active::before {
    left: 0;
}

.category-btn:hover,
.category-btn.active {
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 64, 175, 0.3);
}



.gallery-item {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.8s ease-out;
}

.gallery-item:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

.image-placeholder {
    height: 200px;
    background: linear-gradient(135deg, var(--light-blue), var(--accent-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 1.1rem;
    position: relative;
    overflow: hidden;
}

.image-placeholder::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.gallery-item:hover .image-placeholder::before {
    opacity: 1;
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

.image-info {
    padding: 1.5rem;
}

.image-info h3 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.image-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Contatti */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
}

.contact-info {
    animation: slideInLeft 0.8s ease-out;
}

.contact-info h2 {
    color: var(--primary-blue);
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.contact-item {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(30, 64, 175, 0.1);
}

.contact-item:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-hover);
}

.contact-item h3 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.contact-item p {
    color: var(--text-dark);
    font-weight: 500;
}

.contact-form {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: var(--shadow);
    animation: slideInRight 0.8s ease-out;
    border: 1px solid rgba(30, 64, 175, 0.1);
}

.contact-form h2 {
    color: var(--primary-blue);
    margin-bottom: 2rem;
    font-size: 1.8rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(30, 64, 175, 0.2);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--light-gray);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    transform: scale(1.02);
}

.submit-btn {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 35px rgba(30, 64, 175, 0.4);
}

/* Footer */
footer {
    background: linear-gradient(135deg, rgb(30, 60, 114), rgb(20, 45, 85));
    color: var(--white);
    padding: 3rem 0 1rem;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* Rimosso il background con i pallini */
    animation: float 10s ease-in-out infinite;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #bfdbfe;
    text-decoration: none;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.footer-section a:hover {
    color: #ffffff;
    opacity: 1;
    text-shadow: 0 0 8px rgba(224, 242, 254, 0.6);
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    z-index: 2;
}



.footer-bottom .footer-privacy-link a {
    color: #bfdbfe !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
    opacity: 0.9;
}

.footer-bottom .footer-privacy-link a:hover {
    color: #ffffff !important;
    opacity: 1 !important;
    text-shadow: 0 0 8px rgba(224, 242, 254, 0.6);
    transform: translateY(-1px);
}



/* Responsive Design */
/* Media query per tablet in portrait mode (iPad Air, ecc.) */
@media (max-width: 1024px) and (orientation: portrait) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: 0;
        top: -100vh;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        height: auto;
        text-align: center;
        transition: top 0.3s ease;
        box-shadow: var(--shadow);
        padding: 2rem 0;
        z-index: 999;
    }
    
    .nav-menu.active {
        top: 70px;
    }
    
    /* Nascondi completamente le bandierine desktop su tablet portrait */
    .language-switcher {
        display: none !important;
    }
    
    /* Mostra solo le bandierine mobile vicino al hamburger */
    .mobile-language-switcher {
        display: flex !important;
        position: absolute;
        right: 60px;
        top: 50%;
        transform: translateY(-50%);
        gap: 0.5rem;
    }
}

/* Media query specifica per iPad Pro in landscape mode - mostra menu desktop */
@media (min-width: 1194px) and (max-width: 1366px) and (orientation: landscape) {
    .hamburger {
        display: none;
    }
    
    .nav-menu {
        display: flex;
        position: static;
        flex-direction: row;
        background: transparent;
        width: auto;
        height: auto;
        text-align: left;
        transition: none;
        box-shadow: none;
        padding: 0;
    }
    
    /* Mostra le bandierine desktop su iPad Pro */
    .language-switcher {
        display: flex !important;
    }
    
    /* Nascondi le bandierine mobile */
    .mobile-language-switcher {
        display: none !important;
    }
}

/* Media query per tablet in landscape mode con altezza limitata (escluso iPad Pro) */
@media (max-width: 1194px) and (max-height: 1024px) and (orientation: landscape) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: 0;
        top: -100vh;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        height: auto;
        text-align: center;
        transition: top 0.3s ease;
        box-shadow: var(--shadow);
        padding: 2rem 0;
        z-index: 999;
    }
    
    .nav-menu.active {
        top: 70px;
    }
    
    /* Nascondi completamente le bandierine desktop su tablet landscape */
    .language-switcher {
        display: none !important;
    }
    
    /* Mostra solo le bandierine mobile vicino al hamburger */
    .mobile-language-switcher {
        display: flex !important;
        position: absolute;
        right: 60px;
        top: 50%;
        transform: translateY(-50%);
        gap: 0.5rem;
    }
}

/* Media query per mobile */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: 0;
        top: -100vh;
        flex-direction: column;
        background: var(--white);
        width: 100%;
        height: auto;
        text-align: center;
        transition: top 0.3s ease;
        box-shadow: var(--shadow);
        padding: 2rem 0;
        z-index: 999;
    }
    
    .nav-menu.active {
        top: 70px;
    }
    
    /* Disabilita animazioni su mobile per evitare movimenti indesiderati */
    .nav-menu,
    .hamburger,
    .mobile-language-switcher,
    .lang-btn,
    .navbar .nav-menu,
    .navbar .hamburger,
    .navbar .mobile-language-switcher,
    .navbar .lang-btn {
        animation: none !important;
        transition: none !important;
    }
    
    /* Mantieni l'animazione slideInLeft per il logo su mobile */
    .nav-logo h2 {
        animation: slideInLeft 0.8s ease-out !important;
    }
    
    /* Mantieni solo le trasformazioni necessarie per il posizionamento */
    .hamburger {
        transform: translateY(-50%) !important;
    }
    
    .navbar .mobile-language-switcher {
        transform: translateY(-35%) !important;
    }
    
    /* Previeni layout shift della navbar durante il caricamento del font */
    .navbar {
        font-display: swap;
        contain: layout style;
        min-height: 70px;
    }
    
    /* Posizionamento fisso per hamburger per evitare FOUC */
    .hamburger {
        position: absolute;
        right: 15px;
        top: 50%;
        will-change: auto;
    }
    
    .navbar .mobile-language-switcher {
        width: 70px;
        height: 30px;
        will-change: auto;
    }
    

    
    /* Nascondi completamente le bandierine desktop su mobile */
    .language-switcher {
        display: none !important;
    }
    
    /* Mostra solo le bandierine mobile vicino al hamburger */
    .mobile-language-switcher {
        display: flex !important;
        position: absolute;
        right: 60px;
        top: 50%;
        transform: translateY(-50%);
        gap: 0.5rem;
    }
    
    /* Le bandierine sono già posizionate dalla regola precedente */
    
    .mobile-language-switcher .lang-btn {
        width: 28px;
        height: 21px;
        padding: 2px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 3px;
        background: white;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-language-switcher .lang-btn:hover {
        transform: scale(1.1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    
    .mobile-language-switcher .lang-btn.active {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.2);
    }
    
    .mobile-language-switcher .lang-btn svg {
        width: 16px;
        height: 12px;
    }
    
    .hero {
        padding: 6rem 0 3rem;
        min-height: 80vh;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    /* Nascondi il titolo hero solo su mobile */
    .hero-title {
        display: none;
    }
    
    /* Responsive per achievements */
    .hero-achievements {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .achievement-item {
        width: 100%;
        max-width: 300px;
    }
    
    .bio-timeline::before {
        left: 20px;
    }
    
    /* Forza l'allineamento dei puntini a sinistra su mobile */
    /* Timeline responsive ottimizzata */
    .bio-timeline {
        padding: 0 1rem;
        max-width: 100%;
    }
    
    .bio-timeline::before {
        left: 20px;
        transform: none;
        width: 4px;
    }
    
    .bio-timeline::after {
        left: 20px;
        transform: none;
        width: 5px;
        max-height: calc(100% - 180px);
    }
    
    .bio-timeline .timeline-start {
        left: 22px;
        transform: none;
        width: 12px;
        height: 12px;
    }
    
    .timeline-dots {
        align-items: flex-start !important;
        margin-left: -3px;
        margin-top: 30px;
        padding: 1rem 0;
    }
    
    /* Riduci l'intensità dell'animazione su mobile per le performance */
    .timeline-dots .dot {
        animation-duration: 2.5s;
        width: 8px;
        height: 8px;
        margin: 0 0.3rem;
    }
    
    .timeline-dots::after {
        animation-duration: 4s;
        display: none;
    }
    
    .timeline-item {
        flex-direction: column !important;
        margin-bottom: 2rem;
        padding-left: 0;
    }
    
    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        animation: fadeInScale 0.6s ease-out forwards;
    }
    
    .timeline-item.lazy-load {
        animation-duration: 0.4s;
    }
    
    .timeline-year {
        position: relative;
        left: 0;
        transform: none;
        align-self: flex-start;
        margin-bottom: 1rem;
        margin-top: 0;
        margin-left: -15px;
        padding: 0.8rem 1.2rem;
        font-size: 1rem;
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition-duration: 0.2s;
    }
    


    
    /* Disabilita animazioni glow su mobile */
    .timeline-item:nth-child(4) .timeline-year,
    .timeline-item:nth-child(5) .timeline-year,
    .timeline-item:nth-child(6) .timeline-year,
    .timeline-item:nth-child(7) .timeline-year,
    .timeline-item:nth-child(8) .timeline-year,
    .timeline-item:nth-child(9) .timeline-year,
    .timeline-item:nth-child(10) .timeline-year,
    .timeline-item:nth-child(11) .timeline-year,
    .timeline-item:nth-child(14) .timeline-year {
        animation: none !important;
    }
    
    .timeline-year:active {
        transform: scale(0.95);
        transition: transform 0.1s ease;
        border: 3px solid #ff6b35 !important;
        outline: none;
    }
    
    /* Rimuovi effetti hover su mobile */
    .timeline-item .timeline-year:hover {
        transform: translateX(0) scale(1) !important;
        background: var(--primary-blue) !important;
        box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3) !important;
    }
    
    /* Mantieni colori arancioni per vittorie ma senza animazioni */
    .timeline-item:nth-child(4) .timeline-year:hover,
    .timeline-item:nth-child(5) .timeline-year:hover,
    .timeline-item:nth-child(6) .timeline-year:hover,
    .timeline-item:nth-child(7) .timeline-year:hover,
    .timeline-item:nth-child(8) .timeline-year:hover,
    .timeline-item:nth-child(9) .timeline-year:hover,
    .timeline-item:nth-child(10) .timeline-year:hover,
    .timeline-item:nth-child(14) .timeline-year:hover {
        background: linear-gradient(135deg, #ff6b35, #f7931e) !important;
        box-shadow: 0 4px 15px rgba(255, 107, 53, 0.4) !important;
        transform: translateX(0) scale(1) !important;
    }
    
    .timeline-content {
        width: calc(100% + 20px);
        margin-left: -15px;
        margin-top: -30px;
        padding: 1.5rem;
        /* Ottimizzazioni touch */
        min-height: 44px;
        transition-duration: 0.2s;
    }
    
    .timeline-content h3 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .timeline-content p {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .timeline-content:focus {
        transform: translateY(-2px);
    }
    
    /* Sfondo completamente bianco per timeline-content su mobile per nascondere la linea blu */
    .bio-timeline .timeline-content,
    .timeline-content {
        background: #ffffff !important;
        background-image: none !important;
    }
    
    /* Sfondo completamente bianco per timeline-content.reading su mobile */
    .bio-timeline .timeline-content.reading,
    .timeline-content.reading {
        background: #ffffff !important;
        background-image: none !important;
    }
    
    /* Mantieni opacità completa per timeline-content.read su mobile */
    .bio-timeline .timeline-item.read .timeline-content,
    .timeline-item.read .timeline-content {
        opacity: 1 !important;
        background: #ffffff !important;
        background-image: none !important;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .championship-grid,
    .results-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-privacy-link {
        display: inline;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .section-header h1 {
        font-size: 2rem;
    }
    
    .stat-card {
        padding: 2rem 1.5rem;
    }
    
    .contact-form {
        padding: 2rem;
    }
    

}

/* Nuova Sezione Contatti Elegante */
.contact-section {
    background: linear-gradient(135deg, rgb(30, 60, 114) 0%, rgb(20, 45, 85) 100%);
    padding: 6rem 0;
    position: relative;
    overflow: hidden;
    color: white;
}

.contact-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="dots" width="50" height="50" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100%" height="100%" fill="url(%23dots)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

.contact-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contact-header {
    margin-bottom: 4rem;
    animation: fadeInUp 1s ease-out;
}

.contact-header h1 {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out 0.2s both;
}

.contact-subtitle {
    font-size: 1.4rem;
    font-weight: 300;
    margin-bottom: 1rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.contact-description {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.8;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.contact-cards {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.email-card,
.facebook-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 2rem 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 1s ease-out 0.8s both;
    cursor: pointer;
    text-align: center;
    width: 350px;
    height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.email-card::before,
.facebook-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.email-card:hover::before,
.facebook-card:hover::before {
    left: 100%;
}

.email-card:hover,
.facebook-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

.contact-icon {
    font-size: 3.5rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bounce 2s infinite;
    margin: 0;
}

.contact-content-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    flex-grow: 1;
    justify-content: center;
}

.contact-content-inner h3 {
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0;
    color: white;
    text-align: center;
    line-height: 1.3;
    min-height: 2.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-link {
    display: inline-block;
    font-size: 1.3rem;
    font-weight: 700;
    color: #feca57;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    margin: 0;
    text-align: center;
    min-height: 1.6rem;
    line-height: 1.2;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: #feca57;
    transition: width 0.3s ease;
}

.contact-link:hover::after {
    width: 100%;
}

.contact-link:hover {
    color: #ff6b35;
    transform: scale(1.05);
}

.contact-note {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-top: 0.5rem;
    font-style: italic;
}

.contact-decoration {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, #ff6b35, #feca57);
    border-radius: 50%;
    opacity: 0.1;
    animation: pulse 3s ease-in-out infinite;
}

.facebook-decoration {
    background: linear-gradient(45deg, #1877f2, #42a5f5);
}



.facebook-icon {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.fb-icon-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #1877f2;
    padding: 12px;
    animation: bounce 2s infinite;
    box-shadow: 0 4px 15px rgba(24, 119, 242, 0.3);
    transition: all 0.3s ease;
    object-fit: contain;
}

.fb-icon-img:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(24, 119, 242, 0.5);
}

/* Responsive per la nuova sezione contatti */
@media (max-width: 768px) {
    .contact-section {
        padding: 4rem 0;
    }
    
    .contact-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .email-card,
    .facebook-card {
        padding: 2.5rem 1.5rem;
    }
    
    .contact-link {
        font-size: 1.2rem;
    }
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    user-select: none;
}

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
}

.gallery-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-image:hover {
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes zoomIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive lightbox */
@media (max-width: 768px) {
    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 45px;
        height: 45px;
    }
    
    .lightbox-nav {
        font-size: 24px;
        width: 40px;
        height: 40px;
    }
    
    .lightbox-prev {
        left: 15px;
    }
    
    .lightbox-next {
        right: 15px;
    }
    
    .lightbox-counter {
        bottom: 15px;
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* Gallery Carousel */
.gallery-carousel-container {
    position: relative;
    margin-top: 2rem;
}

.gallery-carousel {
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.gallery-slides {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.gallery-slide {
    min-width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.gallery-slide.active {
    opacity: 1;
}

/* Gallery mode switching */
.gallery-carousel-container.hidden {
    display: none !important;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Ensure smooth transitions between modes */
.gallery-carousel-container,
.gallery-grid {
    transition: opacity 0.3s ease;
}

/* Hide carousel navigation when not needed */
.gallery-carousel-container.hidden .carousel-btn,
.gallery-carousel-container.hidden .carousel-indicators {
    display: none;
}

/* Carousel Navigation Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.carousel-btn:hover {
    background: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.carousel-prev {
    left: -25px;
}

.carousel-next {
    right: -25px;
}

/* Carousel Indicators */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background: #007bff;
    transform: scale(1.2);
}

.indicator:hover {
    background: #0056b3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .gallery-slide {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .carousel-prev {
        left: -20px;
    }
    
    .carousel-next {
        right: -20px;
    }
}

@media (max-width: 480px) {
    .carousel-prev {
        left: 10px;
    }
    
    .carousel-next {
        right: 10px;
    }
}

/* Tre puntini dopo la timeline */
.timeline-dots {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
    gap: 8px;
    position: relative;
}

.timeline-dots .dot {
    width: 8px;
    height: 8px;
    background-color: #007bff;
    border-radius: 50%;
    opacity: 0.7;
    animation: dotFlow 2s ease-in-out infinite;
    position: relative;
}

/* Animazione principale dei puntini */
@keyframes dotFlow {
    0% {
        opacity: 0.3;
        transform: translateY(-5px) scale(0.8);
        box-shadow: 0 0 0 rgba(0, 123, 255, 0);
    }
    50% {
        opacity: 1;
        transform: translateY(0) scale(1.2);
        box-shadow: 0 0 15px rgba(0, 123, 255, 0.6);
    }
    100% {
        opacity: 0.3;
        transform: translateY(5px) scale(0.8);
        box-shadow: 0 0 0 rgba(0, 123, 255, 0);
    }
}

/* Ritardo progressivo per creare effetto cascata */
.timeline-dots .dot:nth-child(1) {
    animation-delay: 0s;
}

.timeline-dots .dot:nth-child(2) {
    animation-delay: 0.3s;
}

.timeline-dots .dot:nth-child(3) {
    animation-delay: 0.6s;
}

/* Effetto hover per interazione */
.timeline-dots:hover .dot {
    animation-duration: 1s;
    background-color: #ff6b35;
}

/* Animazione di pulsazione continua per suggerire "storia in corso" */
@keyframes continuousStory {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* Applica l'animazione di pulsazione all'ultimo puntino */
.timeline-dots .dot:last-child {
    animation: continuousStory 1.5s ease-in-out infinite;
    background: linear-gradient(45deg, #007bff, #ff6b35);
}

/* Effetto di "scia" luminosa che scende */
.timeline-dots::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, 
        rgba(0, 123, 255, 0) 0%,
        rgba(0, 123, 255, 0.3) 30%,
        rgba(0, 123, 255, 0.6) 50%,
        rgba(30, 64, 175, 0.6) 70%,
        rgba(30, 64, 175, 0) 100%);
    animation: lightTrail 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes lightTrail {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* Utility Classes */
.fade-in {
    animation: fadeInUp 0.8s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.8s ease-out;
}

.slide-in-right {
    animation: slideInRight 0.8s ease-out;
}

.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-2 {
    margin-top: 2rem;
}

/* Cookie Banner Styles */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 60, 114, 0.95);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1.5rem;
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-text h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: white;
}

.cookie-text p {
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.9;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.cookie-accept {
    background: var(--primary-blue);
    color: white;
}

.cookie-accept:hover {
    background: var(--secondary-blue);
    transform: translateY(-2px);
}

.cookie-settings {
    background: transparent;
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cookie-settings:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}



/* Cookie Modal */
.cookie-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10001;
}

.cookie-modal.show {
    display: flex;
}

.cookie-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.cookie-modal-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.cookie-modal-close {
    font-size: 2rem;
    cursor: pointer;
    color: #6b7280;
    line-height: 1;
}

.cookie-modal-close:hover {
    color: var(--text-dark);
}

.cookie-modal-body {
    padding: 2rem;
}

.cookie-category {
    margin-bottom: 2rem;
}

.cookie-category:last-child {
    margin-bottom: 0;
}

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.cookie-category h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.cookie-category p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* Cookie Switch */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 24px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .cookie-slider {
    background-color: var(--primary-blue);
}

input:checked + .cookie-slider:before {
    transform: translateX(26px);
}

input:disabled + .cookie-slider {
    background-color: var(--primary-blue);
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-modal-footer {
    padding: 1rem 2rem 2rem;
    text-align: right;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .cookie-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .cookie-btn {
        width: 100%;
        padding: 1rem;
    }
    
    .cookie-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .cookie-modal-header,
    .cookie-modal-body,
    .cookie-modal-footer {
        padding: 1.5rem;
    }
}

/* =================================
   PERFORMANCE OPTIMIZATIONS
   ================================= */

/* Lazy Loading Images */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

img.lazy.loaded {
    opacity: 1;
    background: none;
    animation: none;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Preload Critical Resources */
.preload-critical {
    position: absolute;
    top: -9999px;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Performance Hints */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .particle-system {
        display: none !important;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .hero {
        background: #000;
        color: #fff;
    }
    
    .nav-menu a {
        color: #fff;
        border: 2px solid #fff;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Print Styles */
@media print {
    .nav-menu,
    .hamburger,
    .particle-system,
    .cookie-banner,
    .cookie-modal,
    .lightbox {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        color: #000;
        background: #fff;
    }
    
    .hero {
        background: none;
        color: #000;
        page-break-after: always;
    }
    
    .section {
        page-break-inside: avoid;
        margin-bottom: 2rem;
    }
    
    .gallery-grid {
        display: none;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* Focus Management for Accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
    transition: top 0.3s;
}

.skip-link:focus {
    top: 6px;
}

/* Loading States */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Critical CSS Inlining Optimization */
.above-fold {
    /* Styles for above-the-fold content */
    contain: layout style paint;
}

.below-fold {
    /* Styles for below-the-fold content */
    content-visibility: auto;
    contain-intrinsic-size: 500px;
}

/* Web Vitals Optimization */
.layout-stable {
    /* Prevent layout shifts */
    min-height: 100px;
    aspect-ratio: 16/9;
}

/* Service Worker Update Notification */
.sw-update-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.sw-update-notification.show {
    transform: translateY(0);
    opacity: 1;
}

.sw-update-notification button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-left: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.sw-update-notification button:hover {
    background: rgba(255, 255, 255, 0.3);
}