/* Projects Page Styles */

:root {
    --primary-black: #0a0a0a;
    --secondary-black: #1a1a1a;
    --accent-red: #e50000;
    --pure-white: #ffffff;
    --medium-gray: #888;
    --dark-gray: #333;
    --font-primary: 'Orbitron', monospace;
    --font-secondary: 'Rajdhani', sans-serif;
}

/* Page Layout */
.featured-cars-page {
    min-height: 100vh;
    padding: 100px 0 80px;
    background: rgba(0, 0, 0, 0.27);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 4rem;
    padding-top: 2rem;
}

.page-header h1 {
    font-family: var(--font-primary);
    font-size: clamp(2.5rem, 6vw, 4rem);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--pure-white);
}

.page-header p {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--medium-gray);
    max-width: 700px;
    margin: 0 auto;
}

/* Filters */
.filters-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin-bottom: 3rem;
    padding: 1.5rem;
    border-radius: 18px;
    border: 1px solid rgba(229, 0, 0, 0.28);
    background: linear-gradient(180deg, rgba(14, 14, 14, 0.9), rgba(10, 10, 10, 0.6));
    backdrop-filter: blur(8px);
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.filter-field label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--medium-gray);
}

.filter-field input,
.filter-field select {
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px solid rgba(229, 0, 0, 0.35);
    background: rgba(8, 8, 8, 0.82);
    color: var(--pure-white);
    font-family: var(--font-secondary);
    font-size: 0.95rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.filter-field input:focus,
.filter-field select:focus {
    outline: none;
    border-color: var(--accent-red);
    box-shadow: 0 0 0 2px rgba(229, 0, 0, 0.25);
}

.filter-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
}

.filter-reset {
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    border: 1px solid rgba(229, 0, 0, 0.35);
    background: rgba(229, 0, 0, 0.12);
    color: var(--pure-white);
    font-family: var(--font-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.filter-reset:hover {
    background: rgba(229, 0, 0, 0.28);
    transform: translateY(-2px);
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    border: 4px solid rgba(229, 0, 0, 0.2);
    border-radius: 50%;
    border-top: 4px solid var(--accent-red);
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1.5rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-state p {
    color: var(--medium-gray);
    font-size: 1.1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 6rem 2rem;
}

.empty-icon {
    font-size: 6rem;
    margin-bottom: 2rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--pure-white);
}

.empty-state p {
    color: var(--medium-gray);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

#empty-state-reset {
    margin-bottom: 1.5rem;
}

/* Cars Container */
.cars-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.4rem;
    margin-bottom: 4rem;
}

/* Car Card */
.featured-car-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(229, 0, 0, 0.12), rgba(10, 10, 10, 0.92));
    border-radius: 24px;
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease, border 0.35s ease;
    border: 1px solid rgba(229, 0, 0, 0.22);
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(4px);
}

.featured-car-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
    border-color: rgba(229, 0, 0, 0.45);
}

/* Status Badge */
.car-status-badge {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(229, 0, 0, 0.92);
    color: white;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    z-index: 10;
    box-shadow: 0 12px 24px rgba(229, 0, 0, 0.28);
}

/* Image Gallery Container */
.car-image-gallery {
    position: relative;
    height: 280px;
    overflow: hidden;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
}

.gallery-main-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    cursor: zoom-in;
}

.featured-car-card:hover .gallery-main-image {
    transform: scale(1.05);
}

#modal-main-image {
    cursor: zoom-in;
}

.gallery-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    opacity: 0.3;
}

/* Image Navigation */
.gallery-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 5;
}

/* Fullscreen Image Viewer */
.image-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem 4rem;
    z-index: 12000;
}

.image-viewer.open {
    display: flex;
}

.image-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.image-viewer-content {
    position: relative;
    width: 100%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.image-viewer-main {
    width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
    background: var(--primary-black);
}

.image-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(26, 26, 26, 0.85);
    color: var(--pure-white);
    font-size: 2.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.image-viewer-nav:hover,
.image-viewer-nav:focus-visible {
    background: var(--accent-red);
    border-color: var(--accent-red);
    outline: none;
}

.image-viewer-prev {
    left: -80px;
}

.image-viewer-next {
    right: -80px;
}

.image-viewer-close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(26, 26, 26, 0.85);
    color: var(--pure-white);
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.image-viewer-close:hover,
.image-viewer-close:focus-visible {
    color: var(--accent-red);
    border-color: var(--accent-red);
    outline: none;
}

.image-viewer-caption {
    position: absolute;
    bottom: -48px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--light-gray);
    font-size: 0.95rem;
    letter-spacing: 0.04em;
    text-align: center;
    background: rgba(10, 10, 10, 0.65);
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-dot.active {
    background: var(--accent-red);
    width: 30px;
    border-radius: 5px;
}

.gallery-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

/* Car Info */
.car-info-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2.2rem;
}

.car-card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.car-name {
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    margin: 0;
    color: var(--pure-white);
    font-family: var(--font-primary);
}

.car-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--medium-gray);
}

.car-description {
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(0.96rem, 2vw, 1.05rem);
    line-height: 1.7;
    line-clamp: 3;

    .modal-videos {
        margin-top: 2rem;
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .modal-videos h3 {
        font-size: 1.2rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--medium-gray);
        margin: 0;
    }

    .video-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 1.5rem;
    }

    .modal-video-card {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .modal-video-embed {
        position: relative;
        width: 100%;
        padding-top: 56.25%;
        border-radius: 14px;
        overflow: hidden;
        background: #000;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
    }

    .modal-video-embed iframe,
    .modal-video-embed video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border: 0;
        background: #000;
    }

    .modal-video-caption {
        font-size: 0.9rem;
        color: rgba(255, 255, 255, 0.7);
        line-height: 1.4;
    }
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 72px;
}

/* Specs Grid */
.car-specs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.spec-item {
    background: rgba(10, 10, 10, 0.9);
    padding: 0.85rem 1rem;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: border 0.3s ease, transform 0.3s ease;
}

.spec-item:hover {
    border-color: rgba(229, 0, 0, 0.55);
    transform: translateY(-2px);
}

.spec-label {
    font-size: 0.85rem;
    color: var(--medium-gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.spec-value {
    font-size: 1.2rem;
    color: var(--accent-red);
    font-weight: bold;
}

/* View Details Button */
.car-card-footer {
    margin-top: auto;
}

.view-details-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.view-details-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(229, 0, 0, 0.35);
}

/* Modal Styles */
.car-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    overflow-y: auto;
}

.car-modal.active {
    display: block;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.modal-content {
    position: relative;
    max-width: 1200px;
    margin: 80px auto 40px;
    background: var(--secondary-black);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 2px solid var(--dark-gray);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--accent-red);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #cc0000;
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    padding: 3rem;
}

/* Modal Gallery */
.modal-gallery {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.thumbnail-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    max-height: 170px;
    overflow-y: auto;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(229, 0, 0, 0.65) rgba(255, 255, 255, 0.08);
}

.thumbnail-strip::-webkit-scrollbar {
    height: 6px;
    width: 6px;
}

.thumbnail-strip::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
}

.thumbnail-strip::-webkit-scrollbar-thumb {
    background: rgba(229, 0, 0, 0.65);
    border-radius: 999px;
}

.main-image-container {
    position: relative;
    width: 100%;
    height: 500px;
    background: var(--primary-black);
    border-radius: 15px;
    overflow: hidden;
}

.main-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(229, 0, 0, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-nav:hover {
    background: var(--accent-red);
    transform: translateY(-50%) scale(1.05);
}

.gallery-nav.prev-image {
    left: 15px;
}

.gallery-nav.next-image {
    right: 15px;
}

.gallery-count {
    position: absolute;
    top: 18px;
    left: 18px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(5, 5, 5, 0.65);
    color: var(--pure-white);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    z-index: 6;
}

.gallery-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 5;
    backdrop-filter: blur(6px);
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(5, 5, 5, 0.55);
}

.gallery-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-dot.active {
    background: var(--accent-red);
    width: 28px;
    border-radius: 6px;
}

.gallery-dot:hover {
    background: rgba(255, 255, 255, 0.85);
}

.thumbnail {
    flex: 0 0 120px;
    width: 120px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.25s ease, border 0.25s ease;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail:hover,
.thumbnail.active {
    border-color: var(--accent-red);
    transform: translateY(-2px);
}

/* Modal Details */
.modal-details {
    padding-top: 50px;
}

.modal-details .status-badge {
    display: inline-block;
    background: var(--accent-red);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.modal-details h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--pure-white);
    font-family: var(--font-primary);
}

.modal-details p {
    color: var(--medium-gray);
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 2rem;
    white-space: pre-line;
}

.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.specs-grid .spec-item {
    background: var(--primary-black);
    padding: 1.2rem;
    border-radius: 10px;
    border: 1px solid var(--dark-gray);
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.modal-actions .btn {
    flex: 1;
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--accent-red);
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #cc0000;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-red);
    border: 2px solid var(--accent-red);
}

.btn-secondary:hover {
    background: var(--accent-red);
    color: white;
}

/* Responsive Design */

/* Desktop Large */
@media (min-width: 1400px) {
    .cars-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop */
@media (max-width: 1200px) {
    .cars-container {
        grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
        gap: 2.2rem;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .cars-container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 2rem;
    }
    
    .modal-body {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .main-image-container {
        height: 400px;
    }

    .image-viewer-prev {
        left: -60px;
    }

    .image-viewer-next {
        right: -60px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .featured-cars-page {
        padding: 80px 0 60px;
    }
    
    .page-header {
        margin-bottom: 3rem;
        padding-top: 1rem;
    }
    
    .car-image-gallery {
        height: 260px;
    }
    
    .car-info-section {
        padding: 1.6rem;
    }
    
    .car-specs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .modal-content {
        margin: 60px 15px 20px;
        border-radius: 15px;
    }
    
    .modal-body {
        padding: 2rem 1.5rem;
    }
    
    .modal-close {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        top: 15px;
        right: 15px;
    }

    .image-viewer {
        padding: 2.5rem 1rem 3rem;
    }

    .image-viewer-content {
        max-width: 100%;
    }

    .image-viewer-nav {
        width: 48px;
        height: 48px;
        font-size: 1.8rem;
        background: rgba(26, 26, 26, 0.8);
    }

    .image-viewer-prev {
        left: 12px;
    }

    .image-viewer-next {
        right: 12px;
    }

    .image-viewer-close {
        top: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
    }

    .image-viewer-caption {
        bottom: -36px;
        font-size: 0.85rem;
        padding: 8px 14px;
    }
    
    .main-image-container {
        height: 300px;
    }
    
    .modal-details {
        padding-top: 20px;
    }
    
    .modal-details h2 {
        font-size: 2rem;
    }
    
    .specs-grid {
        grid-template-columns: 1fr;
    }

    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .cars-container {
        gap: 1.5rem;
    }
    
    .car-status-badge {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 0.75rem;
    }
    
    .car-image-gallery {
        height: 220px;
    }
    
    .car-specs-grid {
        grid-template-columns: 1fr;
    }
    
    .spec-item {
        padding: 0.75rem;
    }
    
    .modal-body {
        padding: 1.5rem 1rem;
    }
    
    .thumbnail-strip {
        gap: 0.5rem;
    }
    
    .thumbnail {
        flex: 0 0 90px;
        width: 90px;
        height: 60px;
    }

    .image-viewer {
        padding: 2rem 0.75rem 2.5rem;
    }

    .image-viewer-nav {
        width: 42px;
        height: 42px;
        font-size: 1.5rem;
    }

    .image-viewer-prev {
        left: 8px;
    }

    .image-viewer-next {
        right: 8px;
    }

    .image-viewer-caption {
        bottom: -30px;
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .mobile-menu,
    .car-modal,
    .view-details-btn {
        display: none;
    }
    
    .featured-cars-page {
        padding-top: 0;
    }
}