/* ========================================
   Board Filters - Modern Style
   ======================================== */

/* Filter Pills Bar */
.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.05);
}

.filter-pills-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Search Button (Primary Action) */
.btn-search-pill {
    background: #1396e2;
    color: white;
    border: none;
    border-radius: 24px;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(19, 150, 226, 0.3);
}

.btn-search-pill:hover {
    background: #0d7bc4;
    color: white;
    box-shadow: 0 4px 12px rgba(19, 150, 226, 0.4);
    transform: translateY(-1px);
}

.btn-search-pill i {
    margin-left: 6px;
    transition: color 0.3s ease;
}

/* Search button with changes - icon color changes */
.btn-search-pill.has-changes i {
    color: #ffffff;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

/* Filter Pills */
.filter-pill {
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 24px;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.filter-pill:hover {
    border-color: #1396e2;
    box-shadow: 0 2px 6px rgba(19, 150, 226, 0.2);
}

.filter-pill i {
    margin-left: 6px;
    color: #666;
}

/* ========================================
   Badge Indicators
   ======================================== */

.badge-indicator {
    display: inline-block;
    background: #ff4444;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 13px;
    font-weight: 700;
    margin-right: 6px;
    min-width: 20px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(255, 68, 68, 0.3);
}

.btn-search-pill .badge-indicator {
    background: white;
    color: #1396e2;
}

.filter-pill .badge-indicator {
    background: #1396e2;
    color: white;
}

/* ========================================
   Filter Modals
   ======================================== */

.filter-modal .modal-dialog {
    max-width: 500px;
    margin: 60px auto;
}

.filter-modal .modal-dialog.modal-filter-small {
    max-width: 400px;
}

.filter-modal .modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.filter-modal .modal-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 25px;
}

.filter-modal .modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.filter-modal .modal-body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

.filter-modal .modal-footer {
    background: white;
    border-top: 1px solid #e0e0e0;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ========================================
   Modal Buttons
   ======================================== */

.btn-reset-link {
    color: #999;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
    cursor: pointer;
    padding: 10px;
}

.btn-reset-link:hover {
    color: #666;
    text-decoration: underline;
}

.btn-apply {
    background: #1396e2;
    border: none;
    color: white;
    border-radius: 6px;
    padding: 10px 30px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-apply:hover {
    background: #0d7bc4;
    color: white;
    box-shadow: 0 2px 8px rgba(19, 150, 226, 0.3);
}

/* ========================================
   Filter Search Box
   ======================================== */

.filter-search-box {
    margin-bottom: 20px;
}

.filter-search-box .form-control {
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 15px;
}

.filter-search-box .form-control:focus {
    border-color: #1396e2;
    box-shadow: 0 0 0 3px rgba(19, 150, 226, 0.1);
}

/* ========================================
   Filter Options List (Checkboxes)
   ======================================== */

.filter-options-list {
    max-height: 350px;
    overflow-y: auto;
}

.filter-checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 5px;
}

.filter-checkbox-item:hover {
    background: #f5f5f5;
}

.filter-checkbox-item input[type="checkbox"] {
    margin-left: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filter-checkbox-item span {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

.filter-checkbox-item input[type="checkbox"]:checked + span {
    color: #1396e2;
    font-weight: 600;
}

/* ========================================
   Selected Items Display
   ======================================== */

.selected-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
    min-height: 30px;
}

.selected-item-chip {
    background: #e3f2fd;
    color: #1396e2;
    border: 1px solid #1396e2;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.selected-item-chip .remove {
    cursor: pointer;
    font-weight: bold;
    color: #1396e2;
}

.selected-item-chip .remove:hover {
    color: #0d7bc4;
}

/* ========================================
   Year Range Selector
   ======================================== */

.filter-label-center {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 20px;
}

.year-range-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.year-input-number {
    flex: 1;
    max-width: 150px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 15px;
    text-align: center;
}

.year-input-number:focus {
    border-color: #1396e2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(19, 150, 226, 0.1);
}

/* Remove spinner arrows for year inputs */
.year-input-number::-webkit-inner-spin-button,
.year-input-number::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.year-input-number[type=number] {
    -moz-appearance: textfield;
}

.range-dash {
    font-size: 20px;
    color: #999;
    font-weight: bold;
}

/* ========================================
   Slider Inputs (Price & KM)
   ======================================== */

.filter-group-slider {
    margin-bottom: 30px;
}

.filter-group-slider label {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 15px;
}

.slider-values {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: space-between;
}

.slider-input {
    flex: 1;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 15px;
    text-align: center;
    background: white;
    color: #333;
    font-weight: 500;
}

.slider-input.editable {
    cursor: text;
}

.slider-input:focus {
    border-color: #1396e2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(19, 150, 226, 0.1);
}

.slider-values span {
    color: #999;
    font-size: 18px;
}

/* Dual Range Slider Container */
.dual-range-slider {
    position: relative;
    height: 40px;
    margin-bottom: 10px;
}

.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: transparent;
    border-radius: 3px;
    outline: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Track background - only for the first slider */
.range-slider.range-min::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
}

.range-slider.range-min::-moz-range-track {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
}

/* Active range color between thumbs */
.dual-range-slider::before {
    content: '';
    position: absolute;
    height: 6px;
    background: #1396e2;
    border-radius: 3px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 1;
}

/* Slider Thumbs */
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #1396e2;
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(19, 150, 226, 0.5);
    transition: all 0.2s ease;
    pointer-events: auto;
    position: relative;
    z-index: 3;
}

.range-slider::-webkit-slider-thumb:hover {
    background: #0d7bc4;
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(19, 150, 226, 0.6);
}

.range-slider::-webkit-slider-thumb:active {
    transform: scale(1.25);
}

.range-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: #1396e2;
    border: 3px solid white;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(19, 150, 226, 0.5);
    transition: all 0.2s ease;
    pointer-events: auto;
    position: relative;
    z-index: 3;
}

.range-slider::-moz-range-thumb:hover {
    background: #0d7bc4;
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(19, 150, 226, 0.6);
}

.range-slider::-moz-range-thumb:active {
    transform: scale(1.25);
}

/* Ensure max slider is on top */
.range-slider.range-max {
    z-index: 2;
}

/* ========================================
   Pill Buttons (Hand Selection)
   ======================================== */

.filter-group-pills {
    margin-bottom: 25px;
}

.filter-group-pills label {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 15px;
}

.pill-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pill-btn {
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 40px;
}

.pill-btn:hover {
    border-color: #1396e2;
    color: #1396e2;
}

.pill-btn[data-active="true"] {
    background: #1396e2;
    border-color: #1396e2;
    color: white;
}

/* Range selection styles */
.pill-btn.range-from {
    background: #1396e2;
    border-color: #1396e2;
    color: white;
    position: relative;
}

.pill-btn.range-to {
    background: #1396e2;
    border-color: #1396e2;
    color: white;
    position: relative;
}

.pill-btn.range-between {
    background: rgba(19, 150, 226, 0.3);
    border-color: #1396e2;
    color: #1396e2;
}

/* ========================================
   Select Dropdowns in Modal
   ======================================== */

.filter-group-select {
    margin-bottom: 25px;
}

.filter-group-select label {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: #333;
    margin-bottom: 10px;
}

.filter-group-select .form-control {
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 12px 15px;
    font-size: 15px;
}

.filter-group-select .form-control:focus {
    border-color: #1396e2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(19, 150, 226, 0.1);
}

/* Bootstrap Select (selectpicker) styling */
.filter-group-select .bootstrap-select .btn {
    padding: 0 25px;
}

.filter-group-select .bootstrap-select .btn:focus {
    border-color: #1396e2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(19, 150, 226, 0.1);
}

.filter-group-select .bootstrap-select .btn:focus .btn:hover {
    border-color: #1396e2;
    outline: none;
    box-shadow: 0 0 0 3px rgba(19, 150, 226, 0.1);
}

.filter-group-select .bootstrap-select.open .btn {
    border-color: #1396e2;
}

/* Dropdown menu hover fix */
.filter-group-select .bootstrap-select .dropdown-menu li:hover a {
    color: #666666 !important;
}

.filter-group-select .bootstrap-select .dropdown-menu li.selected:hover a {
    color: #666666 !important;
}

/* ========================================
   Mobile Responsive - Collapsible Filters
   ======================================== */

/* Toggle button for mobile - visible only on mobile */
.filter-toggle-btn {
    display: none;
}

@media (max-width: 768px) {
    /* Show toggle button on mobile */
    .filter-toggle-btn {
        display: block;
        width: 100%;
        background: #1396e2;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 14px 20px;
        font-weight: 600;
        font-size: 16px;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(19, 150, 226, 0.3);
    }

    .filter-toggle-btn:active {
        background: #0d7bc4;
        transform: scale(0.98);
    }

    .filter-toggle-btn i {
        margin-left: 8px;
        transition: transform 0.3s ease;
    }

    .filter-toggle-btn.active i {
        transform: rotate(180deg);
    }

    /* Hide filter pills by default on mobile */
    .filter-pills-bar {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-top: 12px;
        animation: slideDown 0.3s ease;
    }

    /* Show filter pills when expanded */
    .filter-pills-bar.expanded {
        display: flex;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .btn-search-pill,
    .filter-pill {
        width: 100%;
        text-align: center;
        justify-content: center;
        font-size: 16px;
        padding: 12px 20px;
    }

    /* Reduce spacing on mobile */
    .search-filters-wrapper {
        padding: 12px 0;
    }

    .filter-modal .modal-dialog {
        margin: 10px;
        max-width: none;
    }

    .filter-modal .modal-body {
        padding: 20px 15px;
        max-height: 70vh;
    }

    .filter-modal .modal-footer {
        flex-wrap: wrap;
    }

    .pill-buttons {
        justify-content: center;
    }

    .year-range-selector {
        flex-direction: column;
        gap: 10px;
    }

    .year-input-number {
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .filter-modal .modal-header,
    .filter-modal .modal-footer {
        padding: 15px;
    }

    .btn-reset,
    .btn-apply {
        flex: 1;
        padding: 12px 20px;
    }
}
