/* Custom animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(249, 115, 22, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(249, 115, 22, 0.6);
    }
}

@keyframes pulse-orange {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

@keyframes bounce-subtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-3px);
    }
}

/* ── NEW: Mobile hero pan animation (right → left, then reverses) ── */
@keyframes hero-pan-mobile {
    0% {
        background-position: right center;
    }
    100% {
        background-position: left center;
    }
}

/* Utility classes */
.animate-fade-in {
    animation: fade-in 1s ease-out;
}

.animate-slide-in-left {
    animation: slide-in-left 0.8s ease-out;
}

.animate-slide-in-right {
    animation: slide-in-right 0.8s ease-out;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite;
}

.animate-pulse-orange {
    animation: pulse-orange 2s ease-in-out infinite;
}

.animate-bounce-subtle {
    animation: bounce-subtle 2s ease-in-out infinite;
}

/* Hero logo - blends white background away on dark backgrounds */
.hero-logo {
    filter: drop-shadow(white 0px 0px 0px);
    mix-blend-mode: lighten;
    transition: filter 0.3s ease;
}

.hero-logo:hover {
    filter: drop-shadow(0 0 36px rgba(240, 237, 235, 0.8));
}

/* =============================================
   HERO BACKGROUND
   - Desktop: centered (default)
   - Tablet (≤768px): anchored left, slow pan
   - Mobile (≤480px): anchored left top, faster pan
   ============================================= */
.hero-bg {
    background-image: url('img/main\ 1.jpeg');
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
}

/* Tablet */
@media (max-width: 768px) {
    .hero-bg {
        background-position: left center;
        background-size: 160%;
        animation: hero-pan-mobile 14s linear infinite alternate;
    }
}

/* Small phone */
@media (max-width: 480px) {
    .hero-bg {
        background-position: left top;
        background-size: 200%;
        animation: hero-pan-mobile 12s linear infinite alternate;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #000;
}

::-webkit-scrollbar-thumb {
    background: #f97316;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ea580c;
}

/* Selection colors */
::selection {
    background-color: #f97316;
    color: #000;
}

::-moz-selection {
    background-color: #f97316;
    color: #000;
}

/* Focus styles */
button:focus,
a:focus {
    outline: 2px solid #f97316;
    outline-offset: 2px;
}

/* Hover effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Image loading placeholder */
img {
    background-color: rgba(55, 65, 81, 0.3);
    transition: opacity 0.3s ease;
}

img:not([src]) {
    opacity: 0;
}

/* Countdown timer specific styles */
.countdown-container {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.countdown-item {
    background: #f97316;
    color: #000;
    border-radius: 8px;
    min-width: 80px;
    text-align: center;
    padding: 16px;
    font-weight: bold;
}

/* Gallery grid responsive fixes */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid .md\:col-span-2 {
        grid-column: span 1;
    }

    .gallery-grid .md\:row-span-2 {
        grid-row: span 1;
    }
}


/* ============================================ */
/* TIMELINE STYLES                              */
/* ============================================ */

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #f97316, rgba(249, 115, 22, 0.3), #f97316);
    transform: translateX(-50%);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

.timeline-item {
    position: relative;
    margin: 3rem 0;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item::before {
    content: attr(data-year);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 9999px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
    border: 3px solid #000;
}

.timeline-content {
    background: linear-gradient(135deg, #0B0C0C, #16181A);
    border: 1px solid rgba(249, 115, 22, 0.2);
    border-radius: 12px;
    padding: 2rem;
    width: 45%;
    margin-left: 55%;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.timeline-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent, rgba(249, 115, 22, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-content:hover::before {
    opacity: 1;
}

.timeline-content:hover {
    transform: scale(1.02);
    border-color: #f97316;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 0;
    margin-right: 55%;
}

.timeline-badges {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.badge {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

/* Responsive Timeline */
@media (max-width: 768px) {
    .timeline::before {
        left: 2rem;
    }

    .timeline-item::before {
        left: 2rem;
        transform: translateX(-50%);
    }

    .timeline-content {
        width: calc(100% - 4rem);
        margin-left: 4rem;
    }

    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 4rem;
        margin-right: 0;
    }
}

/* Reduced Motion — disables pan animation for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    /* Keep hero image static at left on mobile if motion is reduced */
    .hero-bg {
        background-position: left center !important;
        background-size: cover !important;
        animation: none !important;
    }
}

/* Loading animation */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.2), transparent);
    animation: loading-shimmer 2s infinite;
}

@keyframes loading-shimmer {
    100% {
        left: 100%;
    }
}

/* Mobile menu transitions */
.mobile-menu-enter {
    opacity: 0;
    transform: translateY(-10px);
}

.mobile-menu-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.mobile-menu-exit {
    opacity: 1;
    transform: translateY(0);
}

.mobile-menu-exit-active {
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

/* Intersection observer animations */
.fade-in-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.fade-in-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}


/* ============================================ */
/* RACE RESULTS SECTION                         */
/* ============================================ */

.race-card {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    height: 350px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.race-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(251, 146, 60, 0.3);
}

.race-card-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
}

.race-card:hover .race-card-bg {
    transform: scale(1.1);
}

.race-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0.4) 100%);
}

.race-card-content {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
}

.race-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(251, 146, 60, 0.9);
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.race-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.race-card-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fb923c;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.race-card-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.race-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #d1d5db;
    font-size: 0.875rem;
}

.race-stat-icon {
    color: #fb923c;
    width: 1rem;
    height: 1rem;
}

.race-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #f97316;
    color: #000;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    width: 100%;
    text-decoration: none;
}

.race-card-button:hover {
    background: #fb923c;
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(251, 146, 60, 0.3);
}

.race-card-button-icon {
    width: 1.25rem;
    height: 1.25rem;
}

/* Race card responsive */
@media (max-width: 768px) {
    .race-card {
        height: 320px;
    }

    .race-card-content {
        padding: 1.25rem;
    }

    .race-card-title {
        font-size: 1.25rem;
    }

    .race-card-badge {
        top: 0.75rem;
        right: 0.75rem;
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .race-card-stats {
        gap: 1rem;
    }

    .race-stat {
        font-size: 0.8125rem;
    }

    .race-card-button {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .race-card {
        height: 300px;
    }

    .race-card-title {
        font-size: 1.125rem;
    }

    .race-card-stats {
        flex-direction: column;
        gap: 0.5rem;
    }
}


/* ============================================ */
/* BUTTONS                                      */
/* ============================================ */

.btn-primary {
    background: #f97316;
    color: #000;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-weight: bold;
    transition: all 0.3s ease;
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.btn-primary:hover {
    background: #fb923c;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #f97316;
    border: 2px solid #f97316;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    transform: translateY(0);
}

.btn-secondary:hover {
    background: #f97316;
    color: #000;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.3);
}

/* Header scroll effect */
.header-scrolled {
    background-color: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive text scaling */
@media (max-width: 640px) {
    .text-responsive-xl {
        font-size: 2.5rem;
        line-height: 1.1;
    }
}

@media (min-width: 640px) {
    .text-responsive-xl {
        font-size: 4rem;
        line-height: 1.1;
    }
}

@media (min-width: 1024px) {
    .text-responsive-xl {
        font-size: 6rem;
        line-height: 1;
    }
}

/* Image overlay effects */
.image-overlay {
    position: relative;
    overflow: hidden;
}

.image-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(249, 115, 22, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.image-overlay:hover::before {
    opacity: 1;
}

/* Error states */
.error-state {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

/* Success states */
.success-state {
    background-color: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}