/* ====================================
   Video Background Styles
   ==================================== */

/* Video Container Base */
.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

/* Video Overlay (for better text readability) - LIGHTENED */
.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2); /* Lighter overlay so video is more visible */
    z-index: 1;
    pointer-events: none; /* Allow clicks to pass through */
}

/* Hero Section with Video */
.hero-video-section {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 80px;
}

.hero-video-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
    padding: 60px 20px;
}

.hero-video-content h1 {
    font-size: 56px;
    font-weight: 800;
    margin-bottom: 25px;
    text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.7);
}

.hero-video-content p {
    font-size: 24px;
    font-weight: 300;
    text-shadow: 1px 1px 10px rgba(0, 0, 0, 0.7);
    max-width: 800px;
    margin: 0 auto;
}

/* Model Sections with Video */
.model-video-section {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    overflow: hidden;
    margin: 60px 0;
}

.model-video-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    color: white;
}

.model-video-content h2 {
    font-size: 48px;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.8);
    color: white;
}

.model-video-content p {
    font-size: 18px;
    line-height: 1.8;
    text-shadow: 1px 1px 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 30px;
}

/* Feature Columns with Video */
.features-video-section {
    padding: 100px 0;
    background: var(--bg-light);
}

.features-video-grid {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 30px;
    margin: 0 auto;
    padding: 0;
    flex-wrap: wrap;
}

.feature-video-card {
    flex: 0 0 360px;
    width: 360px;
    position: relative;
    height: 480px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-video-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.feature-video-card .video-background {
    border-radius: 12px;
}

.feature-video-card .video-overlay {
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));
}

.feature-video-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 40px;
    color: white;
}

.feature-video-content h3 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
    color: white;
}

.feature-video-content p {
    font-size: 16px;
    line-height: 1.7;
    text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.8);
}

/* Ken Burns Effect (subtle zoom) */
@keyframes kenburns {
    0% {
        transform: translate(-50%, -50%) scale(1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1.1);
    }
}

.video-background video.kenburns {
    animation: kenburns 30s ease-in-out infinite alternate;
}

/* Video Loading State - FIXED: Hidden by default */
.video-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    z-index: -1;
    display: none; /* Hidden on desktop, shown on mobile via media query */
}

/* Video Poster (fallback image while loading) */
.video-background video[poster] {
    background-size: cover;
    background-position: center;
}

/* Mobile Optimizations */
@media (max-width: 1024px) {
    .features-video-grid {
        grid-template-columns: 1fr;
        gap: 25px;
    }

    .feature-video-card {
        height: 400px;
    }
}

@media (max-width: 768px) {
    /* Keep videos enabled on mobile */
    .video-background video {
        display: block;
    }

    .video-background::before {
        display: none;
    }

    .hero-video-section {
        min-height: 60vh;
    }

    .hero-video-content h1 {
        font-size: 36px;
    }

    .hero-video-content p {
        font-size: 18px;
    }

    .model-video-section {
        min-height: auto;
        padding: 40px 0;
    }

    .model-video-content {
        padding: 40px 15px;
    }

    .model-video-content h2 {
        font-size: 28px;
        line-height: 1.3;
        margin-bottom: 15px;
        word-wrap: break-word;
    }

    .model-video-content p {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 20px;
    }

    .model-video-content .chassis-info {
        font-size: 16px !important;
        margin-bottom: 15px !important;
    }

    /* Fix the inline grid to stack on mobile */
    .model-video-content .container > div[style*="grid-template-columns"] {
        display: block !important;
        grid-template-columns: 1fr !important;
    }

    /* Fix button containers to stack vertically on mobile */
    .model-video-content div[style*="display: flex"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        margin-top: 20px !important;
        align-items: stretch !important;
    }

    /* Fix right-aligned sections */
    .model-video-content div[style*="text-align: right"] {
        text-align: left !important;
    }

    /* Make buttons full width on mobile */
    .model-video-content .btn-primary,
    .model-video-content .btn-secondary {
        width: 100%;
        text-align: center;
        padding: 14px 20px;
        font-size: 13px;
    }

    .feature-video-card {
        height: 350px;
    }

    .feature-video-content {
        padding: 30px;
    }

    .feature-video-content h3 {
        font-size: 24px;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .video-background video.kenburns {
        animation: none;
    }

    .video-background video {
        animation: none;
    }
}

/* Video Controls (hidden by default) */
.video-background video::-webkit-media-controls {
    display: none !important;
}

.video-background video::-webkit-media-controls-enclosure {
    display: none !important;
}

/* Ensure video is always behind content */
.video-background {
    pointer-events: none;
}

/* Smooth video start - FIXED: Always visible */
.video-background video {
    opacity: 1;
}
