/* Page specific styles */
.page-header {
    background-color: var(--primary-color);
    color: white;
    padding: 60px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 36px;
    margin-bottom: 15px;
}

.breadcrumbs {
    margin-bottom: 10px;
}

.breadcrumbs a:hover {
    color: var(--secondary-color);
}

.marketplace-intro {
    padding: 80px 0 40px;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.marketplace-intro h2 {
    font-size: 32px;
    margin-bottom: 20px;
}

.marketplace-intro p {
    font-size: 18px;
    line-height: 1.7;
}

.filter-section {
    padding: 0 0 40px;
}

.filter-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
}

.filter-button {
    padding: 10px 20px;
    background-color: var(--gray-light);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.filter-button:hover {
    background-color: var(--gray-medium);
}

.filter-button.active {
    background-color: var(--secondary-color);
    color: white;
}

.cars-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 60px;
}

.admin-actions {
    margin-top: 30px;
}

/* Car card layout improvements */
.car-card {
    display: flex;
    flex-direction: column;
}

.car-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.car-card:hover {
    transform: translateY(-5px);
}

.car-card.filtered-out {
    opacity: 0;
    display: none;
}

.car-image {
    height: 220px;
    overflow: hidden;
    position: relative;
}

/* Gallery styles */
.gallery-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.gallery-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
}

.gallery-container img.active-image {
    opacity: 1;
    position: relative;
}

.gallery-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.car-image:hover .gallery-controls {
    opacity: 1;
}

.gallery-prev, .gallery-next {
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.gallery-prev:hover, .gallery-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.gallery-dots {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 5px;
    z-index: 2;
}

.gallery-dots .dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
}

.gallery-dots .dot.active {
    background: white;
}

.car-price {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: var(--secondary-color);
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    font-weight: 700;
    z-index: 3;  /* Ensure price is above gallery */
}

.car-details {
    padding: 20px;
}

.car-card .car-details {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.car-title {
    font-size: 22px;
    margin-bottom: 10px;
    font-weight: 700;
}

.car-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
}

.car-spec {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: var(--gray-dark);
}

.car-spec i {
    margin-right: 5px;
    font-size: 16px;
}

.car-description {
    margin-bottom: 20px;
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.6;
}

.car-card .car-description {
    min-height: 60px;
}

.car-actions {
    display: flex;
    justify-content: space-between;
}

.car-card .car-actions {
    margin-top: auto;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    margin-bottom: 80px;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 5px;
    background-color: var(--gray-light);
    cursor: pointer;
    transition: var(--transition);
}

.pagination-item:hover, .pagination-item.active {
    background-color: var(--secondary-color);
    color: white;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .cars-grid {
        grid-template-columns: 1fr;
    }

    .marketplace-intro, .filter-section {
        padding: 50px 0 30px;
    }
    
    .gallery-controls {
        opacity: 1;  /* Always visible on mobile */
    }
    
    .gallery-prev, .gallery-next {
        width: 25px;
        height: 25px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .cars-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.no-cars-message {
    text-align: center;
    padding: 50px 20px;
    margin: 20px auto;
    background-color: #f8f9fa;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    grid-column: 1 / -1; /* Span across all columns in the grid */
}

.no-cars-message i {
    font-size: 48px;
    color: #6c757d;
    margin-bottom: 20px;
}

.no-cars-message h3 {
    margin-bottom: 15px;
    color: #343a40;
}

.no-cars-message p {
    color: #6c757d;
}

/* Category tags styling */
.car-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 8px 0;
}

.category-tag {
    background-color: var(--primary-color);
    color: white;
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 3px;
    display: inline-block;
}