/* Car card */
.car-card {
    padding: 1px;
}

.card {
    background-color: #282534;
    border: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-img-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 0.375rem 0.375rem 0 0;
    aspect-ratio: 4/3;
    background-color: #1a1a1a;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
    padding: 5px;
}

.card-body {
    background-color: #282534;
    padding: 0.55rem;
    text-align: left;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-body .d-flex {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.card-body .car-year {
    color: #fd5631;
    font-size: 0.895rem;
    font-weight: 600;
    margin-bottom: 0;
}

.card-body .card-title {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 300;
    margin-bottom: 0;
    line-height: 1.4;
}

.card-body .car-price {
    text-align: center !important;
    width: 100%;
    margin: 0;
    padding: 0.25rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Feature boxes section */
.feature-box {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    padding: 0.05rem 0.5rem;
    width: fit-content;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.row.g-0 {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
    padding: 0.5rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 0.6rem;
    }

    .card-title {
        font-size: 0.85rem;
    }

    .feature-box {
        font-size: 0.8rem;
        padding: 0.05rem 0.25rem;
    }

    .card-img-wrapper {
        aspect-ratio: 3/2;
    }
}

@media (max-width: 576px) {
    /* Don't apply these rules to profile sections */
    body:not(.profile-page) .car-card,
    .car-listings .car-card {
        min-width: 95%;
        max-width: 95%;
        padding: 4px;
    }

    .card-body {
        padding: 0.75rem;
    }

    .feature-box {
        font-size: 0.75rem;
        padding: 0.05rem 0.15rem;
    }

    .vertical-line {
        height: 16px;
    }
}

/* Add this new style for 5 columns */
.col-lg-2\.4 {
    flex: 0 0 20%;
    max-width: 20%;
}

/* Responsive breakpoints */
@media (min-width: 992px) {
    .col-lg-2\.4 {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .col-md-2\.4 {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .col-sm-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 575.98px) {
    /* Disable the rule that makes cards 100% width in profile pages */
    body:not(.profile-page) .col-sm-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Keep styling for general cards but don't affect the width */
    .card {
        margin: 5px 0;
    }
}

/* Ensure proper spacing between cards */
.row {
    margin-right: -3px;
    margin-left: -3px;
}

/* Add some spacing for mobile view */
@media (max-width: 575.98px) {
    .car-card {
        padding: 10px;
    }

    .card {
        margin: 5px 0;
    }
}

/* Adjust card title and text for smaller screens */
@media (max-width: 767.98px) {
    .card-title {
        font-size: 1.1rem;
    }

    .card-text {
        font-size: 0.9rem;
    }
}

/* Card Styles */
.car-card {
    flex: 0 0 45%;
    max-width: 45%;
    padding: 8px;
    min-width: 230px;
}

@media (min-width: 768px) {
    .car-card {
        flex: 0 0 30%;
        max-width: 30%;
    }
}

@media (min-width: 992px) {
    .car-card {
        flex: 0 0 20%;
        max-width: 20%;
    }
}

.card-footer {
    background-color: #282534;
    border: none;
    padding: 0.5rem 1rem 1rem;
}

.card-footer .border-top {
    border-top: 1px solid #3f3a4c !important;
    padding-top: 1rem;
}

.card-footer .feature-box {
    background-color: #1f1b2c;
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    height: 100%;
    transition: all 0.3s ease;
}

.card-footer .feature-box:hover {
    background-color: #2a2535;
}

.card-footer .feature-icon {
    color: #6c63ff;
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
    display: block;
}

.card-footer .feature-text {
    color: #c8bdcb;
    font-size: 0.75rem;
    margin: 0;
    white-space: nowrap;
}

.card-footer .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.25rem;
    justify-content: space-between;
}

.card-footer .col {
    flex: 1 1 auto;
    padding: 0 0.25rem;
    min-width: 0;
    max-width: 33.333%;
}

.card-img-top {
    height: 200px;
    object-fit: cover;
}

.row.g-2 {
    margin: 0 -0.25rem;
}

.row.g-2 > .col {
    padding: 0 0.25rem;
}

/* Card shadow */
.card {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, border-color 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
}

/* Featured card styles - border removed as requested */
.car-card.featured-listing .card {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.car-card.featured-listing .card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Featured badge container - positioned at bottom-right corner */
.featured-badge-container,
.car-card .featured-badge-container,
#car-listings .featured-badge-container,
.car-grid .featured-badge-container {
    padding: 0 !important;
    margin: 0 !important;
    position: absolute !important;
    top: auto !important; /* Override top positioning */
    left: auto !important; /* Override left positioning */
    bottom: 0 !important; /* Position at bottom edge */
    right: 0 !important; /* Position at right edge */
    z-index: 15 !important; /* Higher z-index to ensure visibility */
    line-height: 0 !important; /* Remove any line height spacing */
    font-size: 0 !important; /* Remove any font size spacing */
    display: block !important; /* Ensure block display */
    transform: none !important; /* Remove any transforms */
}

/* Featured badge - three icons with dynamic background color */
.featured-badge,
.car-card .featured-badge,
#car-listings .featured-badge,
.car-grid .featured-badge {
    position: relative !important; /* Not absolute since container handles positioning */
    top: auto !important;
    left: auto !important;
    bottom: auto !important;
    right: auto !important;
    background: #1f1b2c !important; /* Website body color background */
    color: #fd5631 !important; /* Orange icons representing website theme */
    padding: 3px 5px !important; /* Padding for the three icons */
    font-size: 0.75rem !important; /* Icon size */
    font-weight: normal !important;
    border-radius: 4px 0 0 0 !important; /* Border radius only on top-left corner */
    z-index: 10 !important;
    box-shadow: none !important; /* No shadow on badge container */
    text-transform: none !important;
    letter-spacing: normal !important;
    margin: 0 !important;
    transform: none !important; /* Remove any transforms */
    display: inline-flex !important; /* Use flex for icon alignment */
    align-items: center !important; /* Center icons vertically */
    gap: 1px !important; /* 1px gap between icons */
    line-height: 1 !important;
    white-space: nowrap !important;
    border: none !important; /* No border */
}

/* Add very small shadow to featured badge icons for better visibility */
.featured-badge i {
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.5) !important; /* Very small shadow around icons */
    filter: drop-shadow(0 0 0.5px rgba(0, 0, 0, 0.3)) !important; /* Additional subtle shadow */
}

/* Top placement promotion icon */
.top-placement-icon {
    position: absolute;
    bottom: 0;
    left: 0;
    background-color: #1f1b2c;
    color: #fd5631;
    width: 20px;
    height: 20px;
    border-radius: 0 4px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    margin: 0;
    padding: 0;
}

.top-placement-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}



/* Fallback for bi-leaf icon if Bootstrap Icons doesn't include it */
.featured-badge .bi-leaf::before {
    content: "" !important;
    display: inline-block !important;
    width: 0.75rem !important;
    height: 0.75rem !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-leaf' viewBox='0 0 16 16'%3E%3Cpath d='M1.4 1.7c.216.289.65.84 1.725 1.274 1.093.44 2.884.774 5.834.528l.37-.023c1.823-.06 3.117.598 3.956 1.579C14.16 6.082 14.5 7.41 14.5 8.5c0 .58-.032 1.285-.229 1.997q.198.248.382.54c.756 1.2 1.19 2.563 1.348 3.966a1 1 0 0 1-1.98.198c-.13-.97-.397-1.913-.868-2.77C12.173 13.386 10.565 14 8 14c-1.854 0-3.32-.544-4.45-1.435-1.125-.887-1.89-2.095-2.391-3.383C.16 6.62.16 3.646.509 1.902L.73.806zm-.05 1.39c-.146 1.609-.008 3.809.74 5.728.457 1.17 1.13 2.213 2.079 2.961.942.744 2.185 1.22 3.83 1.221 2.588 0 3.91-.66 4.609-1.445-1.789-2.46-4.121-1.213-6.342-2.68-.74-.488-1.735-1.323-1.844-2.308-.023-.214.237-.274.38-.112 1.4 1.6 3.573 1.757 5.59 2.045 1.227.215 2.21.526 3.033 1.158.058-.39.075-.782.075-1.158 0-.91-.288-1.988-.975-2.792-.626-.732-1.622-1.281-3.167-1.229l-.316.02c-3.05.253-5.01-.08-6.291-.598a5.3 5.3 0 0 1-1.4-.811'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-size: contain !important;
    background-position: center !important;
}

/* Close button */
.btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Car card styles */
.card {
    background: #2b3035;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-actions button {
    background: none;
    border: none;
    padding: 0;
    transition: transform 0.2s ease;
}

.card-actions button:hover {
    transform: scale(1.1);
}

.card-actions i {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s ease;
}

.card-actions .btn-like:hover i:not(.text-danger) {
    color: #dc3545;
}

.card-actions .btn-favorite:hover i:not(.text-primary) {
    color: #0d6efd;
}

.card-body {
    align-items: center !important;
}

.car-year {
    color: #fd5631;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-title {
    color: #fff;
    font-size: 0.8rem;
    font-weight: 400;
    margin-bottom: 0.5rem;
}

.car-price {
    color: #fff;
    font-size: 1.05rem;
    align-items: center !important;
    font-weight: 600;
    text-align: center !important;
}

.feature-divider {
    display: flex;
    align-items: center;
    padding: 0 0.25rem;
}

.vertical-line {
    width: 1px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.2);
}

.row.g-0 {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.row.g-0 > .col-auto {
    padding: 0;
}

.feature-icon {
    color: #fd5631;
    font-size: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .car-card {
        min-width: 250px;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .car-price {
        font-size: 1rem;
    }

    .feature-box {
        font-size: 0.8rem;
        padding: 0.05rem 0.25rem;
    }

    .feature-icon {
        font-size: 0.9rem;
    }

    .card-footer .row {
        flex-wrap: wrap;
    }

    .card-footer .col {
        flex: 0 0 auto;
        width: 33.333%;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 576px) {
    body:not(.profile-page) .car-card,
    .car-listings .car-card {
        min-width: 95%;
        max-width: 95%;
        padding: 4px;
    }

    .card-body {
        padding: 0.75rem;
    }

    .feature-box {
        font-size: 0.75rem;
        padding: 0.05rem 0.15rem;
    }

    .vertical-line {
        height: 16px;
    }

    .card-footer {
        padding: 0.5rem;
    }

    .card-footer .row {
        flex-wrap: wrap;
        margin: 0 -0.125rem;
    }

    .card-footer .col {
        flex: 0 0 auto;
        width: 50%;
        padding: 0 0.125rem;
        margin-bottom: 0.25rem;
    }

    .card-footer .feature-box {
        padding: 0.5rem 0.25rem;
    }

    .card-footer .feature-icon {
        font-size: 1rem;
        margin-bottom: 0.125rem;
    }

    .card-footer .feature-text {
        font-size: 0.7rem;
    }
}

@media (max-width: 375px) {
    .card-footer .col {
        width: 100%;
    }

    .card-footer .feature-text {
        white-space: normal;
    }
}

.card-img-wrapper {
    position: relative;
    overflow: hidden;
}

.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-img-wrapper:hover .hover-overlay {
    opacity: 1;
}

.view-btn {
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.card-img-wrapper:hover .view-btn {
    transform: translateY(0);
}

.card-img-top {
    transition: transform 0.3s ease;
    cursor: pointer;
}

.card-img-wrapper:hover .card-img-top {
    transform: scale(1.02);
}

.row.g-1 {
    margin: 0 -0.125rem;
}

.row.g-1 > .col {
    padding: 0 0.125rem;
}

.row.g-0 {
    margin: 0 -0.05rem;
}

.row.g-0 > .col {
    padding: 0 0.05rem;
    width: auto;
    flex: 0 0 auto;
}

/* Car card loading skeleton */
.car-card-skeleton {
    flex: 0 0 calc(20% - 12px);
    max-width: calc(20% - 12px);
    margin: 6px;
    height: 350px;
    background: #282534;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.car-card-skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.5s infinite;
}

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

/* Update responsive breakpoints for consistent two-column layout */
@media (max-width: 767.98px) {
    .car-card {
        flex: 0 0 45%;
        max-width: 45%;
        min-width: 200px;
        padding: 4px;
    }

    .car-card-skeleton {
        flex: 0 0 calc(33.333% - 12px);
        max-width: calc(33.333% - 12px);
        margin: 6px;
        height: 320px;
    }

    .card-title {
        font-size: 0.9rem;
    }

    .car-price {
        font-size: 1rem;
    }

    .feature-box {
        font-size: 0.8rem;
        padding: 0.05rem 0.25rem;
    }

    .feature-icon {
        font-size: 0.9rem;
    }
}
@media (max-width: 575.98px) {
    .car-card {
        flex: 0 0 48%;
        max-width: 48%;
        min-width: 150px;
        padding: 4px;
    }

    .car-card-skeleton {
        flex: 0 0 calc(50% - 8px) !important;
        max-width: calc(50% - 8px) !important;
        margin: 4px !important;
        height: 280px !important;
    }

    .card-body {
        padding: 0.5rem;
    }

    .card-title {
        font-size: 0.8rem;
    }

    .car-price {
        font-size: 0.9rem;
    }

    .feature-box {
        font-size: 0.75rem;
        padding: 0.05rem 0.15rem;
    }

    .feature-icon {
        font-size: 0.8rem;
    }

    .card-img-top {
        height: 150px;
    }

    .profile-page .car-card .row.g-0 {
        flex-wrap: wrap !important;
        justify-content: space-between;
    }

    .profile-page .car-card .row.g-0 > .col-auto {
        flex: 0 0 auto;
        width: 49%;
        margin-bottom: 0.25rem;
    }
}

/* Mobile-specific styles for car cards - only affects screens below 576px */
@media (max-width: 575.98px) {
    /* Target only the car listings container specifically */
    #car-listings {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 4px !important;
    }

    /* Target all car cards within car listings */
    #car-listings .car-card {
        flex: 0 0 calc(50% - 4px) !important;
        max-width: calc(50% - 4px) !important;
        width: calc(50% - 4px) !important;
        margin: 0 !important;
        padding: 0 !important;
        min-width: 0 !important;
    }

    /* Target skeleton cards within car listings */
    #car-listings .car-card-skeleton,
    #wishlist-grid .car-card-skeleton {
        flex: 0 0 calc(50% - 4px) !important;
        max-width: calc(50% - 4px) !important;
        margin: 0 !important;
        height: 250px !important;
    }
}
