/* ========================================
   GoRent AG - Modern Car Cards Grid System
   ======================================== */

/* ========================================
   Grid Layout - Responsive & Modern
   ======================================== */
.cars-grid {
    display: grid !important;
    gap: 1.5rem;
    grid-template-columns: repeat(3, 1fr);
}

/* ========================================
   View Toggle: Grid vs List
   Apply class `is-list` on the container
   ======================================== */
.cars-grid.is-list {
    grid-template-columns: 1fr !important;
}

.cars-grid.is-list .car-card {
    flex-direction: row;
    min-height: 0;
}

.cars-grid.is-list .car-image {
    width: 40%;
    min-width: 260px;
    aspect-ratio: 16 / 10;
}

.cars-grid.is-list .car-details {
    width: 60%;
}

.cars-grid.is-list .car-specs {
    grid-template-columns: 1fr 1fr;
}

@media (max-width: 768px) {
    .cars-grid.is-list .car-card {
        flex-direction: column;
    }
    .cars-grid.is-list .car-image,
    .cars-grid.is-list .car-details {
        width: 100%;
        min-width: 0;
    }
}

@media (min-width: 1280px) {
    .cars-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .cars-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .cars-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 640px) and (max-width: 767px) {
    .cars-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 639px) {
    .cars-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Ensure cards fill available space */
.cars-grid > * {
    min-width: 0;
}

/* ========================================
   Car Card - Premium Glass Design
   ======================================== */
.car-card {
        position: relative;
        display: flex;
        flex-direction: column;
        border-radius: 20px;
        overflow: hidden;
        background: linear-gradient(
            165deg,
            rgba(255, 255, 255, 0.08) 0%,
            rgba(255, 255, 255, 0.03) 50%,
            rgba(255, 255, 255, 0.01) 100%
        );
        border: 1px solid rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(24px) saturate(150%);
        box-shadow: 
            0 4px 6px -1px rgba(0, 0, 0, 0.1),
            0 10px 15px -3px rgba(0, 0, 0, 0.1),
            0 20px 25px -5px rgba(0, 0, 0, 0.08),
            inset 0 1px 0 rgba(255, 255, 255, 0.05);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        min-height: 420px;
    }

    .car-card.visible {
        opacity: 1;
        transform: translateY(0);
    }

    .car-card:hover {
        transform: translateY(-8px) scale(1.01);
        border-color: rgba(167, 255, 58, 0.25);
        box-shadow: 
            0 8px 12px -2px rgba(0, 0, 0, 0.15),
            0 20px 30px -5px rgba(0, 0, 0, 0.15),
            0 0 40px -10px rgba(167, 255, 58, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }

    /* Light Mode Card */
    [data-theme="light"] .car-card {
        background: linear-gradient(
            165deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(255, 255, 255, 0.85) 50%,
            rgba(248, 250, 252, 0.9) 100%
        );
        border-color: rgba(15, 23, 42, 0.06);
        box-shadow: 
            0 1px 3px rgba(0, 0, 0, 0.04),
            0 4px 12px rgba(0, 0, 0, 0.03),
            0 8px 24px rgba(0, 0, 0, 0.02);
    }

    [data-theme="light"] .car-card:hover {
        border-color: rgba(167, 255, 58, 0.4);
        box-shadow: 
            0 4px 8px rgba(0, 0, 0, 0.06),
            0 12px 28px rgba(0, 0, 0, 0.08),
            0 0 50px -15px rgba(167, 255, 58, 0.2);
    }

    /* ========================================
       Image Container - Modern Aspect
       ======================================== */
    .car-image {
        position: relative;
        overflow: hidden;
        aspect-ratio: 16 / 10;
        background: linear-gradient(
            135deg,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.15) 100%
        );
    }

    [data-theme="light"] .car-image {
        background: linear-gradient(
            135deg,
            rgba(15, 23, 42, 0.04) 0%,
            rgba(15, 23, 42, 0.02) 100%
        );
    }

    .car-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transform: scale(1.03);
        transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        filter: saturate(1.05) brightness(1.02);
    }

    .car-card:hover .car-image img {
        transform: scale(1.1);
        filter: saturate(1.15) brightness(1.05);
    }

    /* Image Overlay Gradient */
    .car-image::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(
            180deg,
            transparent 0%,
            transparent 50%,
            rgba(0, 0, 0, 0.4) 100%
        );
        z-index: 1;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    [data-theme="light"] .car-image::before {
        background: linear-gradient(
            180deg,
            rgba(255, 255, 255, 0) 0%,
            rgba(255, 255, 255, 0) 60%,
            rgba(255, 255, 255, 0.2) 100%
        );
    }

    /* Accent Glow on Image */
    .car-image::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 50%;
        background: radial-gradient(
            ellipse 80% 60% at 20% 10%,
            rgba(167, 255, 58, 0.06) 0%,
            transparent 60%
        );
        z-index: 1;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.4s ease;
    }

    .car-card:hover .car-image::after {
        opacity: 1;
    }

    /* ========================================
       Badges - Modern Pill Style
       ======================================== */
    .car-badge {
        position: absolute;
        top: 12px;
        padding: 6px 12px;
        border-radius: 100px;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        z-index: 10;
        backdrop-filter: blur(12px) saturate(180%);
        transition: all 0.3s ease;
    }

    .car-badge--left {
        left: 12px;
        background: rgba(6, 11, 16, 0.75);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.95);
    }

    .car-badge--right {
        right: 12px;
        background: rgba(167, 255, 58, 0.15);
        border: 1px solid rgba(167, 255, 58, 0.25);
        color: #a7ff3a;
    }

    [data-theme="light"] .car-badge--left {
        background: rgba(255, 255, 255, 0.9);
        border-color: rgba(15, 23, 42, 0.08);
        color: rgba(15, 23, 42, 0.9);
    }

    [data-theme="light"] .car-badge--right {
        background: rgba(34, 197, 94, 0.12);
        border-color: rgba(34, 197, 94, 0.3);
        color: #22c55e;
    }

    .car-card:hover .car-badge {
        transform: translateY(-2px);
    }

    /* ========================================
       Favorite Button - Premium Style
       ======================================== */
    .car-fav {
        position: absolute;
        bottom: 12px;
        right: 12px;
        width: 42px;
        height: 42px;
        border-radius: 14px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(12px) saturate(180%);
        color: rgba(255, 255, 255, 0.9);
        display: grid;
        place-items: center;
        cursor: pointer;
        z-index: 10;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .car-fav:hover {
        transform: translateY(-3px) scale(1.05);
        border-color: rgba(167, 255, 58, 0.4);
        background: rgba(167, 255, 58, 0.15);
        color: #a7ff3a;
        box-shadow: 0 8px 20px rgba(167, 255, 58, 0.2);
    }

    .car-card.is-fav .car-fav {
        border-color: rgba(167, 255, 58, 0.5);
        background: rgba(167, 255, 58, 0.2);
        color: #a7ff3a;
    }

    .car-fav i {
        font-size: 1rem;
        transition: transform 0.3s ease;
    }

    .car-fav:hover i {
        transform: scale(1.15);
    }

    [data-theme="light"] .car-fav {
        background: rgba(255, 255, 255, 0.85);
        border-color: rgba(15, 23, 42, 0.08);
        color: rgba(15, 23, 42, 0.7);
    }

    [data-theme="light"] .car-fav:hover {
        background: rgba(34, 197, 94, 0.12);
        border-color: rgba(34, 197, 94, 0.35);
        color: #22c55e;
    }

    /* ========================================
       Card Details - Clean Layout
       ======================================== */
    .car-details {
        padding: 1.25rem;
        display: flex;
        flex-direction: column;
        gap: 1rem;
        flex: 1;
    }

    .car-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
    }

    .car-title {
        flex: 1;
        min-width: 0;
    }

    .car-title h3 {
        margin: 0;
        font-size: 1.1rem;
        font-weight: 700;
        line-height: 1.3;
        color: rgba(255, 255, 255, 0.95);
        letter-spacing: -0.01em;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .car-title p {
        margin: 6px 0 0;
        font-size: 0.85rem;
        color: rgba(255, 255, 255, 0.55);
        line-height: 1.4;
    }

    [data-theme="light"] .car-title h3 {
        color: rgba(15, 23, 42, 0.95);
    }

    [data-theme="light"] .car-title p {
        color: rgba(15, 23, 42, 0.55);
    }

    /* Price Section */
    .car-price {
        text-align: right;
        white-space: nowrap;
        color: rgba(255, 255, 255, 0.95);
    }

    .car-price > div:first-child {
        font-size: 1.15rem;
        font-weight: 800;
        letter-spacing: 0.01em;
        background: linear-gradient(135deg, #a7ff3a, #41d36a);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    [data-theme="light"] .car-price > div:first-child {
        background: linear-gradient(135deg, #22c55e, #16a34a);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    .car-price > div:last-child {
        font-size: 0.75rem;
        opacity: 0.6;
        margin-top: 2px;
    }

    [data-theme="light"] .car-price {
        color: rgba(15, 23, 42, 0.95);
    }

    /* ========================================
       Specs Grid - Modern Icons
       ======================================== */
    .car-specs {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .spec-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 12px;
        background: rgba(0, 0, 0, 0.25);
        border: 1px solid rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(8px);
        color: rgba(255, 255, 255, 0.75);
        font-size: 0.8rem;
        transition: all 0.3s ease;
        min-width: 0;
    }

    .spec-item:hover {
        background: rgba(167, 255, 58, 0.08);
        border-color: rgba(167, 255, 58, 0.15);
    }

    .spec-item i {
        font-size: 0.9rem;
        color: rgba(167, 255, 58, 0.85);
        flex-shrink: 0;
        width: 16px;
        text-align: center;
    }

    .spec-item span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        line-height: 1.3;
    }

    [data-theme="light"] .spec-item {
        background: rgba(15, 23, 42, 0.03);
        border-color: rgba(15, 23, 42, 0.05);
        color: rgba(15, 23, 42, 0.7);
    }

    [data-theme="light"] .spec-item:hover {
        background: rgba(34, 197, 94, 0.08);
        border-color: rgba(34, 197, 94, 0.2);
    }

    [data-theme="light"] .spec-item i {
        color: #22c55e;
    }

    /* ========================================
       Action Buttons - Premium Style
       ======================================== */
    .car-actions {
        display: flex;
        gap: 10px;
        margin-top: auto;
        padding-top: 4px;
    }

    .car-button {
        flex: 1;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 14px 16px;
        border-radius: 14px;
        font-size: 0.85rem;
        font-weight: 700;
        letter-spacing: 0.01em;
        text-decoration: none;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(8px);
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .car-button:hover {
        transform: translateY(-2px);
        border-color: rgba(167, 255, 58, 0.25);
        background: rgba(167, 255, 58, 0.08);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    }

    .car-button.secondary {
        background: rgba(255, 255, 255, 0.06);
    }

    .car-button.primary {
        background: linear-gradient(135deg, #a7ff3a 0%, #41d36a 100%);
        border-color: transparent;
        color: #00131a;
        box-shadow: 0 4px 16px rgba(167, 255, 58, 0.25);
    }

    .car-button.primary:hover {
        background: linear-gradient(135deg, #b8ff52 0%, #52e47a 100%);
        box-shadow: 0 8px 28px rgba(167, 255, 58, 0.35);
        transform: translateY(-2px);
    }

    .car-button i {
        font-size: 0.9rem;
        transition: transform 0.3s ease;
    }

    .car-button:hover i {
        transform: translateX(2px);
    }

    [data-theme="light"] .car-button {
        background: rgba(255, 255, 255, 0.8);
        border-color: rgba(15, 23, 42, 0.08);
        color: rgba(15, 23, 42, 0.9);
    }

    [data-theme="light"] .car-button:hover {
        background: rgba(34, 197, 94, 0.1);
        border-color: rgba(34, 197, 94, 0.3);
        box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
    }

    [data-theme="light"] .car-button.primary {
        background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
        border-color: transparent;
        color: #fff;
    }

    [data-theme="light"] .car-button.primary:hover {
        box-shadow: 0 8px 28px rgba(167, 255, 58, 0.3);
    }

    /* ========================================
       Modal Styles
       ======================================== */
    .car-modal__meta-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .car-price-highlight {
        font-size: 1.5rem;
        font-weight: 800;
        background: linear-gradient(135deg, #a7ff3a, #41d36a);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    [data-theme="light"] .car-modal__meta-info {
        color: rgba(15, 23, 42, 0.9);
    }

    [data-theme="light"] .car-price-highlight {
        background: linear-gradient(135deg, #22c55e, #16a34a);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }

    /* ========================================
       Animation for Card Entrance
       ======================================== */
    @keyframes cardEntrance {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .car-card {
        animation: cardEntrance 0.5s ease-out forwards;
    }

    .car-card:nth-child(1) { animation-delay: 0.05s; }
    .car-card:nth-child(2) { animation-delay: 0.1s; }
    .car-card:nth-child(3) { animation-delay: 0.15s; }
    .car-card:nth-child(4) { animation-delay: 0.2s; }
    .car-card:nth-child(5) { animation-delay: 0.25s; }
    .car-card:nth-child(6) { animation-delay: 0.3s; }
    .car-card:nth-child(7) { animation-delay: 0.35s; }
    .car-card:nth-child(8) { animation-delay: 0.4s; }
    .car-card:nth-child(9) { animation-delay: 0.45s; }
    .car-card:nth-child(10) { animation-delay: 0.5s; }
    .car-card:nth-child(11) { animation-delay: 0.55s; }
    .car-card:nth-child(12) { animation-delay: 0.6s; }

/* ========================================
   Responsive Adjustments
   ======================================== */
@media (max-width: 768px) {
    .car-card {
        min-height: 380px;
    }

    .car-details {
        padding: 1rem;
        gap: 0.875rem;
    }

    .car-title h3 {
        font-size: 1rem;
    }

    .car-specs {
        gap: 6px;
    }

    .spec-item {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .car-button {
        padding: 12px 14px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .cars-grid {
        gap: 0.75rem;
    }

    .car-badge {
        padding: 5px 10px;
        font-size: 0.65rem;
    }

    .car-fav {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .car-actions {
        flex-direction: column;
    }

    .car-button {
        width: 100%;
    }
}

/* ========================================
   Car View Page Specific Styles
   ======================================== */
.carview-gallery-main {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .carview-gallery-main {
    background: rgba(15, 23, 42, 0.03);
}

.carview-gallery-main img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.carview-thumb {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .carview-thumb {
    background: rgba(15, 23, 42, 0.03);
}

.carview-thumb:hover {
    border-color: rgba(167, 255, 58, 0.4);
}

.carview-thumb.active {
    border-color: #a7ff3a;
    box-shadow: 0 0 20px rgba(167, 255, 58, 0.2);
}

.carview-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

/* Detail Table */
.car-detail-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.9rem;
}

.car-detail-table th,
.car-detail-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .car-detail-table th,
[data-theme="light"] .car-detail-table td {
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

.car-detail-table th {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    width: 40%;
}

[data-theme="light"] .car-detail-table th {
    color: rgba(15, 23, 42, 0.6);
}

.car-detail-table td {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .car-detail-table td {
    color: rgba(15, 23, 42, 0.9);
}

.car-detail-table tr:last-child th,
.car-detail-table tr:last-child td {
    border-bottom: none;
}

/* Modal Specs */
.car-modal__specs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.car-modal__spec-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .car-modal__spec-item {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(15, 23, 42, 0.08);
    color: rgba(15, 23, 42, 0.8);
}

.car-modal__spec-item i {
    color: #a7ff3a;
    font-size: 0.9rem;
}

[data-theme="light"] .car-modal__spec-item i {
    color: #22c55e;
}

.car-modal__features-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 1.5rem 0 1rem;
    color: rgba(255, 255, 255, 0.95);
}

[data-theme="light"] .car-modal__features-title {
    color: rgba(15, 23, 42, 0.95);
}

.car-modal__features-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.car-modal__features-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(167, 255, 58, 0.08);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

[data-theme="light"] .car-modal__features-list li {
    background: rgba(34, 197, 94, 0.1);
    color: rgba(15, 23, 42, 0.85);
}

.car-modal__features-list li::before {
    content: "✓";
    color: #a7ff3a;
    font-weight: 700;
}

[data-theme="light"] .car-modal__features-list li::before {
    color: #22c55e;
}
