/* Hero Banner Styles */
.hero-banner {
    background: linear-gradient(135deg, var(--bs-body-bg) 0%, rgba(var(--bs-primary-rgb), 0.08) 50%, var(--bs-secondary-bg) 100%);
    border-radius: 1rem;
    border: 1px solid var(--bs-border-color);
    min-height: 400px;
    display: flex;
    align-items: center;
}

/* Ensure gradient is visible in both themes */
[data-bs-theme="light"] .hero-banner {
    background: linear-gradient(135deg, var(--bs-body-bg) 0%, rgba(var(--bs-primary-rgb), 0.08) 50%, var(--bs-secondary-bg) 100%);
}

[data-bs-theme="dark"] .hero-banner {
    background: linear-gradient(135deg, var(--bs-body-bg) 0%, rgba(var(--bs-primary-rgb), 0.08) 50%, var(--bs-secondary-bg) 100%);
}

@media (prefers-color-scheme: light) {
    .hero-banner {
        background: linear-gradient(135deg, var(--bs-body-bg) 0%, rgba(var(--bs-primary-rgb), 0.08) 50%, var(--bs-secondary-bg) 100%);
    }
}

@media (prefers-color-scheme: dark) {
    .hero-banner {
        background: linear-gradient(135deg, var(--bs-body-bg) 0%, rgba(var(--bs-primary-rgb), 0.08) 50%, var(--bs-secondary-bg) 100%);
    }
}

.hero-content {
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    z-index: 10;
}

.hero-icon {
    animation: pulse 2s infinite;
}

.hero-logo {
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 0 10px rgba(var(--bs-primary-rgb), 0.3));
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.hero-decoration i {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(var(--rotation, 0deg));
    }

    50% {
        transform: translateY(-8px) rotate(var(--rotation, 0deg));
    }
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
    .hero-banner {
        background: linear-gradient(135deg, var(--bs-body-bg) 0%, rgba(var(--bs-primary-rgb), 0.08) 50%, var(--bs-secondary-bg) 100%) !important;
    }
}

[data-bs-theme="dark"] .hero-banner {
    background: linear-gradient(135deg, var(--bs-body-bg) 0%, rgba(var(--bs-primary-rgb), 0.08) 50%, var(--bs-secondary-bg) 100%) !important;
}

/* F1 Race Track Animation */
.f1-track {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.hero-banner:hover .f1-track {
    opacity: 0.8;
}

.f1-car {
    position: absolute;
    font-size: 1.2rem;
    opacity: 0.4;
    transition: opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
    z-index: 1;
}

.hero-banner:hover .f1-car {
    opacity: 0.7;
}

.car-svg {
    position: relative;
    display: inline-block;
}

.car-icon {
    width: 60px;
    height: 60px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    transition: filter 0.3s ease, transform 0.3s ease;
}

.hero-banner:hover .car-icon {
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4)) brightness(1.1);
    transform: scale(1.05);
}

/* Enhanced Sparks Effects */
.sparks {
    position: absolute;
    top: 50%;
    left: -4px;
    transform: translateY(-50%);
    pointer-events: none;
}

.spark {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(45deg, #ffaa00, #ff6600, #ff0000);
    border-radius: 50%;
    opacity: 0;
    animation: sparkle 0.8s ease-out infinite;
    box-shadow: 0 0 4px rgba(255, 170, 0, 0.6);
}

.spark:nth-child(1) {
    animation-delay: 0s;
    top: -3px;
    left: 0px;
}

.spark:nth-child(2) {
    animation-delay: 0.3s;
    top: 3px;
    left: 4px;
}

.spark:nth-child(3) {
    animation-delay: 0.6s;
    top: 0px;
    left: 8px;
}

@keyframes sparkle {
    0% {
        opacity: 0;
        transform: translateX(0px) scale(0.3);
    }

    30% {
        opacity: 1;
        transform: translateX(-6px) scale(1.2);
    }

    70% {
        opacity: 0.8;
        transform: translateX(-12px) scale(0.8);
    }

    100% {
        opacity: 0;
        transform: translateX(-20px) scale(0.2);
    }
}

/* Racing Numbers with Team Colors */
.car-number {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: bold;
    background: rgba(var(--bs-body-bg-rgb), 0.95);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid;
    pointer-events: none;
    font-family: 'Arial', sans-serif;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.f1-car-redbull .car-number {
    color: #1E41FF;
    border-color: #1E41FF;
}

.f1-car-ferrari .car-number {
    color: #E8002D;
    border-color: #E8002D;
}

.f1-car-mercedes .car-number {
    color: #00D2BE;
    border-color: #00D2BE;
}

.f1-car-mclaren .car-number {
    color: #FF8700;
    border-color: #FF8700;
}

.f1-car-astonmartin .car-number {
    color: #006F62;
    border-color: #006F62;
}

.f1-car-alpine .car-number {
    color: #0090FF;
    border-color: #0090FF;
}

/* Enhanced Radio Chatter */
.radio-chatter {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.radio-message {
    display: inline-block;
    background: rgba(var(--bs-dark-rgb), 0.9);
    color: var(--bs-light);
    padding: 3px 8px 3px 14px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(5px);
    animation: radioChatter 10s ease-in-out infinite;
    border: 1px solid;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Arial', sans-serif;
    position: relative;
}

.radio-message::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: currentColor;
}

/* Driver initials on radio messages */
.f1-car[data-driver="Max Verstappen"] .radio-message::after {
    content: 'VER';
    position: absolute;
    font-size: 0.6rem;
    font-weight: 700;
    left: 3px;
    top: -12px;
    color: #1E41FF;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.f1-car[data-driver="Charles Leclerc"] .radio-message::after {
    content: 'LEC';
    position: absolute;
    font-size: 0.6rem;
    font-weight: 700;
    left: 3px;
    top: -12px;
    color: #E8002D;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.f1-car[data-driver="George Russell"] .radio-message::after {
    content: 'RUS';
    position: absolute;
    font-size: 0.6rem;
    font-weight: 700;
    left: 3px;
    top: -12px;
    color: #00D2BE;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.f1-car[data-driver="Lando Norris"] .radio-message::after {
    content: 'NOR';
    position: absolute;
    font-size: 0.6rem;
    font-weight: 700;
    left: 3px;
    top: -12px;
    color: #FF8700;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.f1-car[data-driver="Fernando Alonso"] .radio-message::after {
    content: 'ALO';
    position: absolute;
    font-size: 0.6rem;
    font-weight: 700;
    left: 3px;
    top: -12px;
    color: #006F62;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.f1-car[data-driver="Pierre Gasly"] .radio-message::after {
    content: 'GAS';
    position: absolute;
    font-size: 0.6rem;
    font-weight: 700;
    left: 3px;
    top: -12px;
    color: #0090FF;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

/* Team-colored radio messages */
.f1-car-redbull .radio-message {
    border-color: rgba(30, 65, 255, 0.6);
    box-shadow: 0 2px 6px rgba(30, 65, 255, 0.4);
    color: #9eabff;
}

.f1-car-ferrari .radio-message {
    border-color: rgba(232, 0, 45, 0.6);
    box-shadow: 0 2px 6px rgba(232, 0, 45, 0.4);
    color: #ff8da7;
}

.f1-car-mercedes .radio-message {
    border-color: rgba(0, 210, 190, 0.6);
    box-shadow: 0 2px 6px rgba(0, 210, 190, 0.4);
    color: #7afffb;
}

.f1-car-mclaren .radio-message {
    border-color: rgba(255, 135, 0, 0.6);
    box-shadow: 0 2px 6px rgba(255, 135, 0, 0.4);
    color: #ffc380;
}

.f1-car-astonmartin .radio-message {
    border-color: rgba(0, 111, 98, 0.6);
    box-shadow: 0 2px 6px rgba(0, 111, 98, 0.4);
    color: #6ee8da;
}

.f1-car-alpine .radio-message {
    border-color: rgba(0, 144, 255, 0.6);
    box-shadow: 0 2px 6px rgba(0, 144, 255, 0.4);
    color: #8acfff;
}

@keyframes radioChatter {

    0%,
    10% {
        opacity: 0;
        transform: translateY(5px);
    }

    15%,
    85% {
        opacity: 1;
        transform: translateY(0px);
    }

    90%,
    100% {
        opacity: 0;
        transform: translateY(-5px);
    }
}

/* Track Lines */
.track-elements {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.15;
    z-index: 0;
}

.track-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(var(--bs-primary-rgb), 0.3) 20%,
            rgba(var(--bs-primary-rgb), 0.6) 50%,
            rgba(var(--bs-primary-rgb), 0.3) 80%,
            transparent 100%);
    animation: trackFlow 8s linear infinite;
}

.track-line-1 {
    top: 10%;
    animation-delay: 0s;
}

.track-line-2 {
    top: 50%;
    animation-delay: 0s;
}

.track-line-3 {
    bottom: 10%;
    animation-delay: 0s;
}

@keyframes trackFlow {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Racing line indicators - enhanced even distribution */
.racing-line {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom,
            transparent 0%,
            rgba(var(--bs-info-rgb), 0.15) 20%,
            rgba(var(--bs-info-rgb), 0.3) 50%,
            rgba(var(--bs-info-rgb), 0.15) 80%,
            transparent 100%);
    opacity: 0.7;
    z-index: 0;
}

/* Stagger animation delays for more natural feel */
.f1-car-redbull .radio-message {
    animation-delay: 1.5s;
}

.f1-car-ferrari .radio-message {
    animation-delay: 4s;
}

.f1-car-mercedes .radio-message {
    animation-delay: 6.5s;
}

.f1-car-mclaren .radio-message {
    animation-delay: 9s;
}

.f1-car-astonmartin .radio-message {
    animation-delay: 2.5s;
}

.f1-car-alpine .radio-message {
    animation-delay: 7.5s;
}

/* Theme adjustments for F1 cars */
[data-bs-theme="dark"] .f1-car {
    opacity: 0.3;
}

[data-bs-theme="dark"] .car-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)) brightness(1.2);
}

@media (prefers-color-scheme: dark) {
    .f1-car {
        opacity: 0.3;
    }

    .car-icon {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5)) brightness(1.2);
    }
}