/**
 * Vebses Apartments System - Filters Panel Styles
 * 
 * Sidebar filters with checkboxes, range sliders, and project logos
 * 
 * @package VebsesApartments
 * @since 1.0.0
 */

/* ==========================================================================
   Filters Container
   ========================================================================== */

.re-filters {
    width: 100%;
    font-family: inherit;
}

/* ==========================================================================
   Filter Section
   ========================================================================== */

.re-filters__section {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--re-border-divider);
}

.re-filters__section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.re-filters__title {
    font-family: inherit;
    font-size: var(--re-font-size-xl);
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--re-text-primary);
}

/* Title row with toggle */
.re-filters__title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.re-filters__title-row .re-filters__title {
    margin-bottom: 0;
}

/* Currency Toggle in Filters - matches 3D/2D toggle exactly */
.re-filters .re-currency-toggle {
    position: relative !important;
    border: 1px solid #767676 !important;
    padding: 3px !important;
    background: #FFFFFF !important;
    display: inline-flex !important;
    gap: 0 !important;
    border-radius: 20px !important;
    flex-shrink: 0 !important;
    box-sizing: border-box !important;
    line-height: 1 !important;
    overflow: hidden !important;
    width: auto !important;
    height: auto !important;
}

.re-filters .re-currency-toggle__bg {
    position: absolute !important;
    top: 3px !important;
    left: 3px !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    max-width: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    background: #510B0B !important;
    border-radius: 50% !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 0 !important;
    box-sizing: border-box !important;
    pointer-events: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    aspect-ratio: 1 / 1 !important;
}

/* Default: USD active (right side) - pill moves right */
.re-filters .re-currency-toggle[data-active="usd"] .re-currency-toggle__bg {
    transform: translateX(28px) !important;
}

/* When GEL is active, pill stays left (no transform) */
.re-filters .re-currency-toggle[data-active="gel"] .re-currency-toggle__bg {
    transform: translateX(0) !important;
}

.re-filters .re-currency-toggle__btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    transition: color 0.2s ease !important;
    background: transparent !important;
    color: #000000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: inherit !important;
    border-radius: 50% !important;
    position: relative !important;
    z-index: 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    aspect-ratio: 1 / 1 !important;
}

.re-filters .re-currency-toggle__btn:hover,
.re-filters .re-currency-toggle__btn:focus,
.re-filters .re-currency-toggle__btn:active {
    background: transparent !important;
    color: #000000 !important;
}

.re-filters .re-currency-toggle__btn:not(.re-currency-toggle__btn--active):hover {
    color: #510B0B !important;
}

.re-filters .re-currency-toggle__btn--active,
.re-filters .re-currency-toggle__btn--active:hover,
.re-filters .re-currency-toggle__btn--active:focus,
.re-filters .re-currency-toggle__btn--active:active {
    color: #FFFFFF !important;
    background: transparent !important;
}

/* ==========================================================================
   Project Grid (Logo Selection)
   ========================================================================== */

.re-filters__project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.re-filters__project {
    width: 100%;
    padding: 20px;
    border: 1px solid var(--re-border-default);
    border-radius: var(--re-radius-sm);
    background: var(--re-bg-white);
    cursor: pointer;
    transition: all var(--re-transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    aspect-ratio: 4/3;
}

.re-filters__project:hover {
    border-color: var(--re-brand-primary);
    transform: translateY(-2px);
    box-shadow: var(--re-shadow-md);
}

.re-filters__project--selected {
    border-color: var(--re-brand-primary);
    background: var(--re-brand-light);
    box-shadow: 0 2px 8px rgba(81, 11, 11, 0.15);
}

.re-filters__project-logo {
    max-width: 100%;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.re-filters__project-name {
    font-family: inherit;
    font-size: var(--re-font-size-sm);
    font-weight: 600;
    color: var(--re-text-primary);
    text-align: center;
    text-transform: uppercase;
}

/* ==========================================================================
   Checkbox Grid
   ========================================================================== */

.re-filters__checkbox-grid {
    display: grid;
    gap: 12px;
}

.re-filters__checkbox-grid--single {
    grid-template-columns: 1fr;
}

.re-filters__checkbox-grid--triple {
    grid-template-columns: repeat(3, 1fr);
}

/* ==========================================================================
   Checkbox Option
   ========================================================================== */

.re-filters__checkbox {
    width: 100%;
    padding: 16px 20px;
    border: 1px solid var(--re-border-default);
    border-radius: var(--re-radius-sm);
    background: var(--re-bg-white);
    cursor: pointer;
    transition: all var(--re-transition-normal);
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.re-filters__checkbox:hover {
    border-color: var(--re-brand-primary);
    transform: translateY(-2px);
    box-shadow: var(--re-shadow-md);
}

.re-filters__checkbox--selected {
    border-color: var(--re-brand-primary);
    background: var(--re-brand-light);
}

.re-filters__checkbox--disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.re-filters__checkbox--disabled:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--re-border-default);
}

/* Hidden native checkbox */
.re-filters__checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Custom Checkbox Indicator */
.re-filters__checkbox-indicator {
    width: 20px;
    height: 20px;
    border: 2px solid var(--re-border-default);
    border-radius: var(--re-radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--re-transition-normal);
    flex-shrink: 0;
}

.re-filters__checkbox--selected .re-filters__checkbox-indicator {
    border-color: var(--re-brand-primary);
    background: var(--re-brand-primary);
}

.re-filters__checkbox-indicator::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--re-bg-white);
    border-radius: var(--re-radius-full);
    opacity: 0;
    transition: opacity var(--re-transition-fast);
}

.re-filters__checkbox--selected .re-filters__checkbox-indicator::after {
    opacity: 1;
}

/* Checkbox Label */
.re-filters__checkbox-label {
    font-family: inherit;
    font-size: var(--re-font-size-md);
    font-weight: 500;
    color: var(--re-text-primary);
}

/* Block labels should be uppercase */
.re-filters__checkbox-grid--triple .re-filters__checkbox-label {
    text-transform: uppercase;
}

/* ==========================================================================
   Range Slider
   ========================================================================== */

.re-filters__range-container {
    padding: 20px 0;
}

/* Range Values Display */
.re-filters__range-values {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    font-family: inherit;
    font-size: var(--re-font-size-lg);
    font-weight: 600;
    color: var(--re-text-primary);
}

/* Range Slider Wrapper */
.re-filters__range-wrapper {
    position: relative;
    height: 6px;
    background: var(--re-border-divider);
    border-radius: 3px;
}

/* Active Track */
.re-filters__range-track {
    position: absolute;
    height: 100%;
    background: var(--re-brand-primary);
    border-radius: 3px;
    z-index: 0;
    left: 0;
    width: 100%;
}

/* Range Slider Container */
.re-filters__range-slider {
    position: relative;
    width: 100%;
    height: 40px;
    margin-top: -17px;
}

/* Range Input (Hidden native, custom styled) */
.re-filters__range-input {
    position: absolute;
    width: 100%;
    height: 40px;
    top: 0;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    padding: 0;
}

.re-filters__range-input::-webkit-slider-runnable-track {
    background: transparent;
    height: 6px;
}

.re-filters__range-input::-moz-range-track {
    background: transparent;
    height: 6px;
}

/* Range Thumb - WebKit */
.re-filters__range-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--re-brand-primary);
    border: 3px solid var(--re-bg-white);
    border-radius: var(--re-radius-full);
    cursor: pointer;
    pointer-events: all;
    box-shadow: var(--re-shadow-sm);
    transition: all var(--re-transition-fast);
    position: relative;
    z-index: 10;
    margin-top: -7px;
}

.re-filters__range-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(81, 11, 11, 0.4);
}

/* Range Thumb - Firefox */
.re-filters__range-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--re-brand-primary);
    border: 3px solid var(--re-bg-white);
    border-radius: var(--re-radius-full);
    cursor: pointer;
    pointer-events: all;
    box-shadow: var(--re-shadow-sm);
    transition: all var(--re-transition-fast);
    position: relative;
    z-index: 10;
}

.re-filters__range-input::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 10px rgba(81, 11, 11, 0.4);
}

/* ==========================================================================
   Reset Filters Button
   ========================================================================== */

.re-filters__reset {
    display: block;
    width: 100%;
    padding: 16px;
    margin-top: 30px;
    background: transparent;
    border: 1px solid var(--re-border-default);
    border-radius: var(--re-radius-sm);
    font-family: inherit;
    font-size: var(--re-font-size-md);
    font-weight: 500;
    color: var(--re-text-tertiary);
    cursor: pointer;
    transition: all var(--re-transition-normal);
    text-align: center;
}

.re-filters__reset:hover {
    border-color: var(--re-brand-primary);
    color: var(--re-brand-primary);
    background: var(--re-brand-light);
}

/* ==========================================================================
   Loading State
   ========================================================================== */

.re-filters--loading {
    position: relative;
    pointer-events: none;
}

.re-filters--loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 768px) {
    .re-filters__project-grid {
        grid-template-columns: 1fr;
    }
    
    .re-filters__checkbox-grid--triple {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .re-filters__section {
        margin-bottom: 30px;
        padding-bottom: 30px;
    }
}

@media (max-width: 480px) {
    .re-filters__checkbox-grid--triple {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Mobile Drawer (Optional Enhancement)
   ========================================================================== */

@media (max-width: 1024px) {
    .re-filters-drawer {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 360px;
        height: 100vh;
        background: var(--re-bg-white);
        transform: translateX(-100%);
        transition: transform var(--re-transition-smooth);
        z-index: 1000;
        overflow-y: auto;
        padding: 20px;
        box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    }
    
    .re-filters-drawer--open {
        transform: translateX(0);
    }
    
    .re-filters-drawer__overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: all var(--re-transition-normal);
        z-index: 999;
    }
    
    .re-filters-drawer--open + .re-filters-drawer__overlay {
        opacity: 1;
        visibility: visible;
    }
    
    .re-filters-drawer__close {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        cursor: pointer;
        font-size: 24px;
        color: var(--re-text-primary);
    }
    
    .re-filters-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: var(--re-bg-white);
        border: 1px solid var(--re-border-default);
        border-radius: var(--re-radius-sm);
        font-family: inherit;
        font-size: var(--re-font-size-sm);
        font-weight: 500;
        color: var(--re-text-primary);
        cursor: pointer;
    }
    
    .re-filters-toggle:hover {
        border-color: var(--re-brand-primary);
    }
}

@media (min-width: 1025px) {
    .re-filters-toggle,
    .re-filters-drawer__close,
    .re-filters-drawer__overlay {
        display: none;
    }
}
