/* Vehicles Page Specific Styles */
.page-header {
    background: linear-gradient(135deg, #1a365d 0%, #2c5aa0 100%);
    padding: 120px 0 80px;
    text-align: center;
    color: white;
}

.page-header h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
}

.page-header p {
    font-size: 1.2rem;
    color: #e6f3ff;
}

/* Filters */
.filters {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 8px;
}

.filter-group input,
.filter-group select {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #3182ce;
}

/* Additional styles for AutoScout24 integration */

/* Filter Section */
.filters-section {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.filters-section h3 {
    margin-bottom: 1.5rem;
    color: var(--navy);
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.filter-row:last-child {
    margin-bottom: 0;
}

.price-group, .year-group {
    min-width: 250px;
}

.price-inputs, .year-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-inputs input, .year-inputs input {
    width: 100px;
}

.price-inputs span, .year-inputs span {
    font-size: 0.9rem;
    color: #666;
}

/* Results Info */
.results-info {
    margin-top: 1rem;
}

#results-count {
    background: var(--light-blue);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Vehicle Cards Enhanced */
.vehicles-section {
    padding: 40px 0 80px;
}

.vehicle-card {
    position: relative;
    overflow: hidden;
}

.badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #28a745;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.badge-new {
    background: #17a2b8;
}

.vehicle-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(45deg, #e53e3e, #fc8181);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
}

.vehicle-badge.eco {
    background: linear-gradient(45deg, #38a169, #68d391);
}

.vehicle-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.vehicle-details span {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
}

.vehicle-details i {
    margin-right: 6px;
    color: #3182ce;
    width: 16px;
}

.vehicle-features {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #666;
    margin: 0.5rem 0;
    min-height: 1.2rem;
}

.feature {
    background: #e6f3ff;
    color: #1a365d;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.vehicle-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.vehicle-actions .btn {
    flex: 1;
    font-size: 0.9rem;
    padding: 0.5rem;
}

.vehicle-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.vehicle-bottom .btn {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #666;
    cursor: pointer;
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.close:hover {
    color: #1a365d;
    background: #f7fafc;
}

.vehicle-detail-header {
    position: relative;
    padding: 40px 40px 20px;
    background: linear-gradient(135deg, #e6f3ff 0%, #ffffff 100%);
    border-radius: 15px 15px 0 0;
}

.vehicle-detail-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(45deg, #3182ce, #1a365d);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.vehicle-detail-image i {
    font-size: 5rem;
    color: white;
}

.vehicle-detail-info {
    padding: 0 40px 40px;
}

.vehicle-detail-title {
    font-size: 2rem;
    color: #1a365d;
    margin-bottom: 10px;
}

.vehicle-detail-price {
    font-size: 2.2rem;
    color: #3182ce;
    font-weight: 700;
    margin-bottom: 20px;
}

.price-section {
    text-align: center;
    margin-bottom: 18px;
}

.price-section .price {
    font-size: 2rem;
    margin: 0;
}

.details-section {
    margin-bottom: 18px;
}

.details-section h4 {
    margin-bottom: 10px;
}

.details-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-row {
    display: flex;
    gap: 18px;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.detail-item {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.detail-item .label {
    font-weight: 500;
    color: #666;
}

.detail-item .value {
    font-weight: 600;
    color: var(--navy);
}

.detail-item i {
    margin-right: 6px;
    color: #3182ce;
    width: 16px;
}

.features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: #f8fafc;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.feature-tag {
    background: #e3f2fd;
    color: var(--light-blue);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.contact-dealer {
    background: linear-gradient(135deg, #1a365d 0%, #2c5aa0 100%);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
}

.contact-dealer h3 {
    margin-bottom: 15px;
}

.contact-dealer p {
    margin-bottom: 20px;
    color: #e6f3ff;
}

.contact-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.contact-buttons .btn {
    flex: 1;
    max-width: 200px;
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 3000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background: linear-gradient(45deg, #38a169, #68d391);
}

.toast-error {
    background: linear-gradient(45deg, #e53e3e, #fc8181);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e6f3ff;
    border-top: 4px solid #3182ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

.loading-spinner {
    text-align: center;
    padding: 3rem;
    color: var(--navy);
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.no-results-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-results i {
    font-size: 3rem;
    color: #ccc;
    margin-bottom: 1rem;
}

.no-results h3 {
    color: var(--navy);
    margin-bottom: 1rem;
}

.no-results p {
    color: #666;
    margin-bottom: 2rem;
}

/* Vehicle Detail Header */

/* Car Details Modal Styles (for dynamically created modals) */
.modal-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    cursor: pointer;
}

.car-details-modal {
    position: relative;
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 1;
    animation: modalSlideIn 0.3s ease;
}

.car-details-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.car-details-modal .modal-header h2 {
    color: #1a365d;
    font-size: 1.8rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f7fafc;
    color: #1a365d;
}

.car-details-modal .modal-body {
    padding: 30px;
}

.car-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.car-image-large {
    width: 100%;
    height: 300px;
    background: linear-gradient(45deg, #3182ce, #1a365d);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.car-image-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.car-placeholder-large {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.price-section {
    margin-bottom: 30px;
}

.price-section .price {
    font-size: 2rem;
    font-weight: 700;
    color: #1a365d;
    margin: 0;
}

.details-section,
.features-section {
    margin-bottom: 30px;
}

.details-section h4,
.features-section h4 {
    color: #1a365d;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.details-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-row {
    display: flex;
    gap: 18px;
}

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.detail-item .label {
    color: #64748b;
    font-weight: 500;
}

.detail-item .value {
    color: #1a365d;
    font-weight: 600;
}

.features-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-tag {
    background: #e6f3ff;
    color: #1a365d;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.contact-section {
    text-align: center;
}

.btn-large {
    margin-bottom: 12px;
    width: 100%;
    padding: 15px 30px;
    font-size: 1.1rem;
}

.description-section {
    padding: 8px 40px;
    font-size: 1.12rem;
    line-height: 1.7;
    background: #fff;
    border-radius: 12px;
    margin: 0 0;
}

.description-section h4 {
    color: #1a365d;
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.description-section p {
    line-height: 1.6;
    color: #4a5568;
}

/* Responsive Design for Car Details Modal */
@media (max-width: 768px) {
    .car-details-modal {
        width: 95%;
        max-height: 95vh;
    }
    
    .car-details-modal .modal-header,
    .car-details-modal .modal-body {
        padding: 20px;
    }
    
    .car-details-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .car-image-large {
        height: 200px;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .price-section .price {
        font-size: 1.6rem;
    }
}

/* Scrollbar hiding for car details modal */
.car-details-modal::-webkit-scrollbar {
    display: none;
}

.car-details-modal {
    scrollbar-width: none;
}

/* Carousel and modal styles */
.car-image-carousel {
    position: relative;
    max-width: 600px;
    margin: 0 auto 24px auto;
}
.carousel-image {
    width: 100%;
    max-width: 600px;
    height: 350px;
    border-radius: 16px;
    object-fit: cover;
    transition: opacity 0.3s;
}
.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    font-size: 1.7rem;
    z-index: 2;
    cursor: pointer;
    user-select: none;
    display: block;
    align-items: center;
    justify-content: center;
    padding: 0;
}
.carousel-prev {
    left: 12px;
}
.carousel-next {
    right: 12px;
}
.carousel-indicator {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30,49,93,0.8);
    color: #fff;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 1rem;
}

/* Responsive carousel sizing */
@media (max-width: 768px) {
    .car-image-carousel {
        max-width: 420px;
        margin: 0 auto 18px auto;
    }
    .carousel-image {
        max-width: 420px;
        height: 250px;
    }
    .carousel-prev, .carousel-next {
        width: 36px;
        height: 36px;
        font-size: 1.5rem;
    }
    .carousel-prev {
        left: 8px;
    }
    .carousel-next {
        right: 8px;
    }
    .carousel-indicator {
        bottom: 8px;
        padding: 2px 12px;
        border-radius: 12px;
        font-size: 0.95rem;
    }
}

@media (max-width: 700px) {
    .car-details-modal .details-rows {
        gap: 8px !important;
    }
    .car-details-modal .detail-row {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .car-details-modal .detail-item-responsive {
        min-width: 0 !important;
        width: 100% !important;
        box-sizing: border-box;
        padding: 12px 8px !important;
        font-size: 1rem !important;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
    }
    .car-details-modal .detail-item-responsive .label {
        font-size: 0.98rem !important;
        color: #223;
        font-weight: 600;
        margin-bottom: 2px;
    }
    .car-details-modal .detail-item-responsive .value {
        font-size: 1.13rem !important;
        font-weight: 700;
        color: #223;
        margin-bottom: 0;
    }
}
.car-details-modal .detail-item-responsive {
    background: #f7f9fb;
    border-radius: 8px;
    padding: 14px 14px;
    min-width: 120px;
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    font-size: 1.08rem;
    box-sizing: border-box;
}
.car-details-modal .detail-item-responsive .label {
    color: #223;
    font-weight: 500;
    margin-right: 8px;
}
.car-details-modal .detail-item-responsive .value {
    font-weight: 700;
    color: #223;
    font-size: 1.13rem;
}

        .vehicles-grid {
            display: flex;
            flex-direction: column;
            gap: 32px;
        }
        .vehicle-card {
            display: flex;
            flex-direction: row;
            align-items: stretch;
            background: #fff;
            border-radius: 16px;
            box-shadow: 0 4px 24px rgba(0,0,0,0.08);
            overflow: hidden;
            min-height: 180px;
            width: 100%;
            border: 1px solid #e5e7eb;
            transition: box-shadow 0.2s;
        }
        .vehicle-card:hover {
            box-shadow: 0 8px 32px rgba(0,0,0,0.13);
        }
        .vehicle-card .vehicle-image {
            min-width: 200px;
            max-width: 240px;
            width: 220px;
            height: 160px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: #f7f7f7;
            border-radius: 12px 0 0 12px;
            overflow: hidden;
            text-align: center;
            margin: 18px 0 18px 18px;
        }
        .vehicle-card .vehicle-image img {
            width: auto;
            height: 100%;
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            margin: 0 auto;
            display: block;
            border-radius: 8px;
            background: #fff;
            box-shadow: none;
        }
        .vehicle-card .vehicle-info {
            flex: 1 1 0%;
            padding: 24px 32px 24px 32px;
            display: flex;
            flex-direction: column;
            justify-content: center;
        }
        .vehicle-card .vehicle-info h3 {
            margin-top: 0;
            margin-bottom: 8px;
            font-size: 1.3rem;
            font-weight: 700;
        }
        .vehicle-card .vehicle-details {
            color: #555;
            font-size: 1rem;
            margin-bottom: 8px;
        }
        .vehicle-card .vehicle-features {
            color: #3b82f6;
            font-size: 0.98rem;
            margin-bottom: 10px;
        }
        .vehicle-card .vehicle-price {
            font-size: 1.5rem;
            font-weight: 700;
            margin-bottom: 18px;
        }

        .vehicle-card .vehicle-actions {
            display: flex;
            gap: 12px;
            margin-top: auto;
        }
        .vehicle-card .vehicle-actions .btn {
            min-width: 120px;
            padding: 10px 0;
            font-size: 1rem;
        }
        @media (max-width: 900px) {
            .vehicle-card .vehicle-info {
                padding: 18px 12px 18px 12px;
            }
            .vehicle-card .vehicle-image {
                margin: 12px 0 12px 12px;
            }
        }
        @media (max-width: 700px) {
            .vehicle-card {
                flex-direction: column;
                min-height: unset;
            }
            .vehicle-card .vehicle-image {
                max-width: 100%;
                min-width: 0;
                width: 100%;
                border-radius: 12px 12px 0 0;
                height: 220px;
                margin: 0;
                display: flex;
                align-items: center;
                justify-content: center;
            }
            .vehicle-card .vehicle-image img {
                width: 100%;
                height: 100%;
                object-fit: cover;
                border-radius: 12px 12px 0 0;
            }
            .vehicle-card .vehicle-info {
                padding: 14px 12px;
            }
        }
        .car-details-modal ul {
            padding-left: 2.2em;
            margin-bottom: 0.7em;
        }
        .car-details-modal ul li {
            margin-left: 0.5em;
            padding-left: 0.2em;
            text-indent: 0;
        }