.page-board {
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

p {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

/* Search Filters */
.search-filters-wrapper {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 0;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    z-index: 100;
}

/* Bootstrap Select Styling */
.bootstrap-select {
    width: 100% !important;
}

.bootstrap-select .btn {
    border: 1px solid #ddd;
    border-radius: 4px;
    height: 40px;
    padding: 6px 12px;
    font-size: 14px;
    text-align: right;
    background: white;
}

.bootstrap-select .btn:focus,
.bootstrap-select .btn:active {
    border-color: #1396e2 !important;
    box-shadow: 0 0 0 2px rgba(19, 150, 226, 0.2) !important;
}

.bootstrap-select .dropdown-menu {
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    border: 1px solid #ddd;
    z-index: 1060;
}

.bootstrap-select .dropdown-menu li a {
    text-align: right;
    padding: 8px 12px;
}

.bootstrap-select .dropdown-menu li.selected a {
    background-color: #1396e2;
    color: white;
}

.bootstrap-select .dropdown-menu li:hover a {
    background-color: #f5f5f5;
    color: #666666;
}

.bootstrap-select .dropdown-menu li.selected:hover a {
    color: #666666;
}

.main-filters .row {
    margin: 0 -5px;
}

.main-filters [class*="col-"] {
    padding: 0 5px;
    margin-bottom: 10px;
}

.filter-select {
    border-radius: 4px;
    border: 1px solid #ddd;
    height: 40px;
    font-size: 14px;
}

.btn-search {
    width: 100%;
    height: 40px;
    background: #1396e2;
    border: none;
    border-radius: 4px;
    font-weight: bold;
}

.btn-search:hover {
    background: #0d7bc4;
}

.active-filters-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.active-filters-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
    white-space: nowrap;
}

.active-filters-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

/* Results Section */
.results-header {
    padding: 20px 0;
}

.results-header span {
    font-size: 15px;
    font-weight: 600;
    color: #4a5568;
}

.results-header h2 {
    font-size: 20px;
    margin: 0;
    border-bottom: 0px;
}

/* Sort Pill Button */
.sort-dropdown-wrapper {
    display: inline-block;
}

.sort-pill-btn {
    background: white;
    border: 0px solid #d0d0d0;
    border-radius: 0px;
    padding: 0px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    color: #4a5568;
}

.sort-pill-btn i {
    margin-right: 6px;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.sort-pill-btn[aria-expanded="true"] i {
    transform: rotate(180deg);
}

/* Sort Dropdown Menu */
.sort-dropdown-menu {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    min-width: 220px;
    margin-top: 8px;
}

.sort-dropdown-menu li {
    list-style: none;
}

.sort-dropdown-menu li a {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s ease;
    font-size: 14px;
    position: relative;
}

.sort-dropdown-menu li a:hover {
    color: #333;
}

.sort-dropdown-menu li.active a {
    color: #1396e2;
    font-weight: 600;
    background-color: #ffffff !important;
}

.sort-dropdown-menu li.active a:hover {
    color: #1396e2;
    font-weight: 600;
    background-color: #ffffff !important;
}

.sort-dropdown-menu li a i.fa-check {
    margin-left: 8px;
    color: #1396e2;
}

/* Car Grid */
.cars-grid .row {
    margin: 0 -10px;
    display: flex;
    flex-wrap: wrap;
}

.cars-grid [class*="col-"] {
    padding: 0 10px;
    margin-bottom: 20px;
    display: flex;
}

/* Car Cards - Modern Design */
.car-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    height: 100%;
    width: 100%;
    border: 1px solid rgba(0,0,0,0.06);
    position: relative;
    display: flex;
    flex-direction: column;
}

.car-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #1396e2 0%, #0d7bc4 100%);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

.car-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.car-card:hover::before {
    transform: scaleX(1);
}

.car-image {
    position: relative;
    height: 180px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    flex-shrink: 0;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.car-card:hover .car-image img {
    transform: scale(1.05);
}

.car-image-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
}

.car-image-placeholder i {
    font-size: 56px;
}

.car-details {
    padding: 16px;
    display: flex;
    flex-direction: column;
    text-align: right;
    flex: 1;
}

.car-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 8px 0;
    line-height: 1.4;
    text-align: right;
    letter-spacing: -0.2px;
}

.car-info-line {
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 12px;
    text-align: right;
    font-weight: 500;
}

.car-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: auto;
}

.car-price {
    font-size: 20px;
    font-weight: 700;
    color: #1396e2;
    text-align: left;
    letter-spacing: -0.3px;
}

.car-info {
    font-size: 12px;
    color: #888;
    text-align: right;
}

.car-year-hand {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}

.car-model {
    font-size: 14px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.car-year {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

.car-km {
    font-size: 13px;
    color: #888;
    margin-bottom: 0;
}

.car-hand {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

/* Pagination */
.pagination-wrapper {
    margin: 50px 0 20px;
}

.pagination > li > a {
    color: #1396e2;
    border-color: #e0e0e0;
    font-weight: 500;
    border-radius: 8px;
    margin: 0 3px;
    transition: all 0.2s ease;
}

.pagination > .active > a {
    background-color: #1396e2;
    border-color: #1396e2;
    box-shadow: 0 2px 8px rgba(19, 150, 226, 0.3);
}

.pagination > li > a:hover {
    background-color: #f8f9fa;
    color: #0d7bc4;
    border-color: #1396e2;
    transform: translateY(-1px);
}

/* Modal Styles */
.modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-title {
    color: #333;
    font-weight: bold;
}

/* Mobile Responsive - List Layout */
@media (max-width: 768px) {
    .search-filters-wrapper {
        padding: 15px 0;
    }

    /* Primary filters on mobile - full width stacking */
    .main-filters > .row:first-child {
        margin: 0;
    }

    .main-filters > .row:first-child > [class*="col-"] {
        width: 100%;
        padding: 0 15px;
        margin-bottom: 12px;
    }

    .main-filters label {
        margin-bottom: 6px;
        font-size: 13px;
    }

    /* Advanced toggle button on mobile */
    .btn-advanced-toggle {
        margin-top: 10px;
        font-size: 15px;
        height: 45px;
    }

    /* Full-width search button on mobile */
    .main-filters .col-xs-12.col-sm-12 {
        margin-top: 5px;
    }

    .btn-search {
        height: 45px;
        font-size: 16px;
    }

    .active-filters-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .active-filters-chips {
        width: 100%;
    }

    .filter-chip {
        font-size: 12px;
        padding: 5px 10px;
    }

    .btn-clear-all {
        width: 100%;
        padding: 10px;
    }

    /* Grid Layout Mobile Adjustments */
    .year-range,
    .price-range,
    .km-range {
        flex-direction: row;
    }

    .year-input,
    .price-input,
    .km-input {
        flex: 1;
        min-width: 0;
    }


    .results-header {
        text-align: center;
    }

    .results-header .col-sm-6 {
        margin-bottom: 15px;
    }

    .sort-dropdown-wrapper {
        display: block;
        text-align: center;
    }

    .sort-pill-btn {
        width: 100%;
    }

    /* Mobile List Layout */
    .cars-grid .row [class*="col-"] {
        width: 100%;
        padding: 0 10px;
        margin-bottom: 12px;
    }

    .car-card {
        display: flex;
        flex-direction: row;
        height: auto;
        border-radius: 8px;
    }

    .car-image {
        width: 120px;
        height: 110px;
        flex-shrink: 0;
        border-radius: 0 8px 8px 0;
        order: 2;
    }

    .car-image-placeholder i {
        font-size: 32px;
    }

    .car-details {
        flex: 1;
        padding: 10px 12px;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        text-align: right;
        order: 1;
    }

    .car-title {
        font-size: 15px;
        font-weight: bold;
        color: #1396e2;
        margin: 0 0 6px 0;
        text-align: right;
        line-height: 1.3;
    }

    .car-info-line {
        font-size: 12px;
        color: #666;
        margin-bottom: 8px;
        text-align: right;
    }

    .car-footer-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        margin-top: auto;
    }

    .car-price {
        font-size: 16px;
        font-weight: bold;
        color: #1396e2;
        text-align: left;
    }

    .car-info {
        font-size: 11px;
        color: #888;
        text-align: right;
    }

    .car-model {
        display: none;
    }

    .car-year,
    .car-hand,
    .car-km {
        display: none;
    }

    .car-year-hand {
        display: none;
    }

}

@media (max-width: 480px) {
    .main-filters [class*="col-xs-6"] {
        width: 100%;
        margin-bottom: 10px;
    }

    .filter-select,
    .btn-search {
        height: 45px;
        font-size: 16px; /* Prevent zoom on iOS */
    }

    .car-info {
        flex-direction: column;
        gap: 5px;
    }


    .pagination {
        font-size: 14px;
    }

    .pagination > li > a {
        padding: 8px 12px;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #FF6B35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Hover Effects */
.filter-select:focus {
    border-color: #1396e2;
    box-shadow: 0 0 0 2px rgba(19, 150, 226, 0.2);
}

/* RTL Adjustments */
[dir="rtl"] .car-info span {
    flex-direction: row-reverse;
}

[dir="rtl"] .car-location i {
    margin-right: 5px;
    margin-left: 0;
}

[dir="rtl"] .checkbox-group input {
    margin-right: 8px;
    margin-left: 0;
}