/* ===== FERRARI MINIMAL STYLE - IMOLA WEC EXPERIENCE ===== */

/* ===== ROOT & VARIABLES ===== */
:root {
    --ferrari-red: #DC0000;
    --black: #000000;
    --white: #FFFFFF;
    --gray-light: #F5F5F5;
    --gray-medium: #E8E8E8;
    --gray-dark: #333333;
    --transition: all 0.3s ease;
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    color: var(--black);
    background: var(--white);
    line-height: 1.6;
}

/* ===== SHARED ICON STYLES ===== */
.small-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    vertical-align: middle;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

/* ===== HERO SECTION ===== */
.hero {
    height: 100vh;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.7) 100%), url('images/hero2.webp') center / cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(220, 0, 0, 0.1) 50%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1;
}

.hero-inner {
    position: relative;
    z-index: 2;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== STORY ANIMATIONS - FERRARI STYLE ===== */
@keyframes cardReveal {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(30px);
        filter: blur(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

@keyframes lineScaleIn {
    from {
        height: 0;
        opacity: 0;
    }
    to {
        height: 2px;
        opacity: 1;
    }
}

.hero-title {
    font-size: clamp(3rem, 8vw, 8rem);
    font-weight: 300;
    letter-spacing: 8px;
    margin-bottom: 1rem;
    line-height: 1;
}

.hero-logo {
    max-width: 100%;
    height: auto;
    max-height: 45vh;
    margin-bottom: 2rem;
    object-fit: contain;
    animation: fadeInUp 1s ease-out;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.hero-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.3rem);
    font-weight: 300;
    letter-spacing: 2px;
    opacity: 0.85;
}

/* ===== STORY SECTION ===== */
.story-section {
    padding: 8rem 2rem;
    background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
    position: relative;
}

.story-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ferrari-red), transparent);
}

.story-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 3rem;
    position: relative;
}

.day-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    animation: cardReveal 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    border: 1px solid rgba(220, 0, 0, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.day-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--ferrari-red), transparent);
    border-radius: 8px 8px 0 0;
}

.day-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(220, 0, 0, 0.15);
    border-color: var(--ferrari-red);
}

.day-card:nth-child(1) {
    animation-delay: 0s;
}

.day-card:nth-child(2) {
    animation-delay: 0.1s;
}

.day-card:nth-child(3) {
    animation-delay: 0.2s;
}

.day-card-inner {
    display: flex;
    flex-direction: column;
}

.day-number {
    font-size: 3.5rem;
    font-weight: 300;
    background: linear-gradient(135deg, var(--ferrari-red), #ff4444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.8rem;
    letter-spacing: 4px;
}

.day-title {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: var(--black);
    margin-bottom: 1.2rem;
    text-transform: uppercase;
}

.day-divider {
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--ferrari-red), transparent);
    margin-bottom: 1.8rem;
    animation: lineScaleIn 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    border-radius: 1px;
}

.day-text {
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--gray-dark);
    font-weight: 300;
}

/* ===== HIGHLIGHTS SECTION ===== */
.highlights-section {
    padding: 8rem 2rem;
    background: var(--black);
    position: relative;
    overflow: hidden;
}

.highlights-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(220, 0, 0, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.highlights-container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.section-heading {
    font-size: 2rem;
    font-weight: 300;
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 5rem;
    color: var(--white);
    text-transform: uppercase;
    position: relative;
}

.section-heading::after {
    content: '';
    display: block;
    width: 100px;
    height: 2px;
    background: var(--ferrari-red);
    margin: 1.5rem auto 0;
}

.highlights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.highlight-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2.5rem 2rem;
    border: 1px solid rgba(220, 0, 0, 0.3);
    border-radius: 6px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    backdrop-filter: blur(10px);
}

.highlight-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(220, 0, 0, 0.1), transparent);
    border-radius: 6px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.highlight-card:hover {
    border-color: var(--ferrari-red);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(220, 0, 0, 0.2);
}

.highlight-card:hover::before {
    opacity: 1;
}

.highlight-card h4 {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: var(--white);
    margin-bottom: 1rem;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.highlight-card p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 300;
    position: relative;
    z-index: 1;
}

/* ===== TRACK MAP SECTION ===== */
.track-map-section {
    background: linear-gradient(180deg, var(--gray-light) 0%, var(--white) 100%);
    padding: 6rem 2rem;
}

.track-map-container {
    max-width: 1200px;
    margin: 0 auto;
}

.track-map-container .section-heading {
    color: var(--black);
}

.map-subtitle {
    text-align: center;
    font-size: 16px;
    color: var(--gray-dark);
    margin-bottom: 3rem;
}

.track-map-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 3rem;
    align-items: stretch;
}

.track-viewpoints-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.viewpoint-card {
    background: var(--white);
    border: 2px solid var(--gray-light);
    border-radius: 8px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.viewpoint-card:hover {
    border-color: var(--ferrari-red);
    box-shadow: 0 4px 12px rgba(220, 0, 0, 0.15);
    transform: translateX(4px);
}

.viewpoint-card.active {
    background: linear-gradient(135deg, rgba(220, 0, 0, 0.08) 0%, rgba(220, 0, 0, 0.02) 100%);
    border-color: var(--ferrari-red);
    box-shadow: 0 4px 16px rgba(220, 0, 0, 0.2);
}

.viewpoint-icon {
    min-width: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.viewpoint-icon .small-icon {
    width: 42px;
    height: 42px;
}

.viewpoint-content h3 {
    color: var(--black);
    font-size: 1rem;
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.viewpoint-content p {
    color: var(--gray-dark);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

.track-map-image-wrapper {
    background: var(--white);
    border: 1px solid var(--gray-dark);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.track-map-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

#imola-map {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

.track-map-image-wrapper .leaflet-container {
    background: #d9e6d1;
    font-family: inherit;
}

.track-map-image-wrapper .leaflet-control-attribution {
    font-size: 10px;
}

.track-map-image-wrapper .leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.track-map-image-wrapper .leaflet-popup-content {
    margin: 10px 12px;
    font-size: 0.85rem;
    line-height: 1.45;
}

.track-map-image-wrapper .track-zone-label {
    background: rgba(0, 0, 0, 0.75);
    color: var(--white);
    border: 1px solid rgba(220, 0, 0, 0.4);
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.track-map-svg {
    width: 100%;
    max-width: 350px;
    height: auto;
    margin: 0 auto;
}

.track-line {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.track-point {
    fill: var(--ferrari-red);
    cursor: pointer;
    transition: r 0.3s ease, filter 0.3s ease;
    filter: drop-shadow(0 2px 6px rgba(220, 0, 0, 0.4));
}

.track-point:hover {
    r: 16px;
    filter: drop-shadow(0 4px 12px rgba(220, 0, 0, 0.6));
}

.track-point.active {
    r: 16px;
    filter: drop-shadow(0 4px 12px rgba(220, 0, 0, 0.6));
}

.track-label {
    font-size: 12px;
    fill: var(--gray-dark);
    text-anchor: middle;
    font-weight: 600;
    pointer-events: none;
}

@media (max-width: 768px) {
    .track-map-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .track-viewpoints-list {
        gap: 0.8rem;
    }
    
    .viewpoint-card {
        padding: 1rem;
    }
    
    .viewpoint-icon {
        font-size: 1.5rem;
        min-width: 2rem;
    }
    
    .viewpoint-content h3 {
        font-size: 0.9rem;
    }
    
    .viewpoint-content p {
        font-size: 0.8rem;
    }
    
    .track-map-image-wrapper {
        min-height: 300px;
    }

    #imola-map {
        min-height: 300px;
    }
}

/* ===== GALLERY SECTION ===== */
.gallery-section {
    padding: 8rem 2rem;
    background: var(--white);
    position: relative;
}

.gallery-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ferrari-red), transparent);
}

.gallery-container {
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 3rem;
}

.gallery-item {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: 8px;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(220, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gallery-item:hover {
    border-color: var(--ferrari-red);
    box-shadow: 0 12px 40px rgba(220, 0, 0, 0.2);
    transform: translateY(-4px);
}

.gallery-image {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gallery-item:hover .gallery-image img {
    transform: scale(1.05);
}

.gallery-caption {
    padding: 1.2rem;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-caption p {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-dark);
    text-align: center;
    line-height: 1.4;
    letter-spacing: 0.5px;
    margin: 0;
}

.gallery-item:hover .gallery-caption p {
    color: var(--ferrari-red);
    transition: color 0.4s ease;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--black);
    color: var(--white);
    padding: 4rem 2rem;
    text-align: center;
    border-top: 1px solid rgba(220, 0, 0, 0.3);
}

.footer p {
    font-size: 0.9rem;
    letter-spacing: 2px;
    font-weight: 300;
    opacity: 0.7;
    text-transform: uppercase;
}

/* Footer home link */
.footer .footer-home {
    color: inherit;
    text-decoration: none;
    margin-left: 8px;
    font-weight: 600;
}
.footer .footer-home:hover,
.footer .footer-home:focus {
    text-decoration: underline;
    outline: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    .story-section {
        padding: 4rem 1.5rem;
    }

    .story-container {
        gap: 3rem;
    }

    .day-number {
        font-size: 2.5rem;
    }

    .highlights-section {
        padding: 4rem 1.5rem;
    }

    .highlights-grid {
        gap: 2rem;
    }

    .gallery-section {
        padding: 4rem 1.5rem;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.85rem;
    }

    .story-section,
    .highlights-section,
    .gallery-section {
        padding: 3rem 1rem;
    }

    .day-number {
        font-size: 2rem;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }
}