/* ===================================
   REVS CAR COLLECTION CAROUSEL
   Matching main gallery aesthetic - clean, minimal
   =================================== */

/* Carousel Container - Clean like main gallery */
.revs-car-carousel {
    position: relative;
    width: 100%;
    margin: 2rem 0;
    padding: 0;
    background: transparent;
    min-height: 400px;
}

/* Carousel Header - Clean minimal with better spacing */
.carousel-header {
    text-align: center;
    margin-bottom: 4rem;
    padding: 3rem 0 2rem 0;
    position: relative;
    z-index: 100;
}

.carousel-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.carousel-subtitle {
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    letter-spacing: 1px;
}

/* Carousel Track Container */
.carousel-track-container {
    position: relative;
    overflow: visible;
    padding: 0;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    min-height: 250px;
}

/* Carousel Track */
.carousel-track {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
    gap: 0;
    position: relative;
    left: 0;
    top: 0;
    height: auto;
    min-height: 200px;
}

/* Car Item - Match main gallery card style */
.carousel-car-item {
    flex: 0 0 auto;
    width: 280px;
    height: auto;
    margin: 0 1rem;
    position: relative;
    cursor: pointer;
    transition: all 0.4s ease;
    transform-origin: center center;
    background: var(--revs-bg-card);
    border: 1px solid var(--revs-border-subtle);
    overflow: hidden;
    display: block;
    visibility: visible;
}

/* Car Item States - No red glow */
.carousel-car-item:hover {
    transform: translateY(-10px);
    z-index: 10;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

.carousel-car-item.active {
    transform: translateY(-10px);
    z-index: 15;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Car Image Container - Override main styles */
.revs-car-carousel .car-image-container,
.revs-car-carousel .car-image {
    position: relative;
    width: 100%;
    height: 200px !important; /* Override the height: 0 from main styles */
    padding-bottom: 0 !important; /* Override the 66.67% padding-bottom */
    background: #1a1a1a;
    overflow: visible;
    display: block;
}

/* Loading spinner for lazy images */
.car-image-container.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid var(--revs-accent-red);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 5;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Car Image - Force visibility - Override main gallery styles */
.revs-vehicle-collection-container .revs-car-carousel .carousel-car-item img.car-image {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: 200px !important;
    padding-bottom: 0 !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 1 !important;
    transition: opacity 0.4s ease !important;
}

.carousel-car-item:hover .car-image {
    -webkit-transform: translateZ(0) scale(1.1);
    transform: translateZ(0) scale(1.1);
}

/* Car Overlay - Match main gallery gradient */
.car-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 30px 20px 20px;
    color: white;
    z-index: 2;
    pointer-events: none;
}

/* Car Year Badge - Match main gallery */
.car-year {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.9);
    color: var(--revs-accent-gold);
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    font-size: 1em;
    z-index: 2;
}

/* Car Title */
.car-name {
    font-family: 'Roboto', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Navigation Buttons - Hidden */
.carousel-nav-btn {
    display: none;
}

/* Carousel Indicators - Better spacing */
.carousel-indicators {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    margin-top: 1rem;
    gap: 12px;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-indicator.active {
    background: var(--revs-accent-red);
    transform: scale(1.3);
    box-shadow: none;
}

.carousel-indicator:hover {
    background: rgba(220, 53, 69, 0.7);
    transform: scale(1.1);
}

/* Loading State */
.carousel-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Roboto', sans-serif;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #dc3545;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Ultra-Wide Displays - Maximum cars for crisp images */
@media (min-width: 1701px) {
    .carousel-car-item {
        width: 220px; /* Smaller to fit 6.5 cars crisply */
        margin: 0 0.7rem;
    }
}

/* Large Displays - 20% more cars */
@media (min-width: 1401px) and (max-width: 1700px) {
    .carousel-car-item {
        width: 240px; /* Slightly smaller to fit more cars */
        margin: 0 0.8rem;
    }
}

/* Responsive Design */
@media (max-width: 1400px) and (min-width: 1201px) {
    .carousel-car-item {
        width: 280px;
        margin: 0 1rem;
    }
}

@media (max-width: 1200px) {
    .carousel-car-item {
        width: 250px;
        margin: 0 0.8rem;
    }
}

@media (max-width: 768px) {
    .carousel-title {
        font-size: 1.4rem;
        letter-spacing: 2px;
    }
    
    .carousel-subtitle {
        font-size: 0.9rem;
    }
    
    .carousel-car-item {
        width: 220px;
        margin: 0 0.8rem;
    }
    
    .car-name {
        font-size: 1rem;
    }
    
    .car-year {
        font-size: 0.9rem;
        padding: 0.4rem 0.8rem;
    }
    

}

@media (max-width: 480px) {
    .carousel-car-item {
        width: 200px;
        margin: 0 0.5rem;
    }
    
    .car-name {
        font-size: 0.9rem;
    }
    
    .car-year {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    

}

/* Touch/Swipe Support Enhancement */
.carousel-track-container.dragging {
    cursor: grabbing;
    user-select: none;
}

.carousel-track-container.dragging .carousel-car-item {
    pointer-events: none;
}

/* Performance Optimizations */
.carousel-car-item,
.car-image,
.car-overlay {
    will-change: transform, opacity;
}

/* Fade in animation for initial load */
.revs-car-carousel {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hide carousel on very small screens if needed */
@media (max-width: 320px) {
    .revs-car-carousel {
        display: none;
    }
}
