/**
 * Vebses Apartments System - Active Filters & Sorting Styles
 * 
 * Filter tags and sorting dropdown
 * 
 * @package VebsesApartments
 * @since 1.0.0
 */

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

.re-active-filters-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 20px 0;
    flex-wrap: wrap;
}

/* ==========================================================================
   Currency Toggle (GEL/USD)
   Matches 3D/2D toggle exactly - same animation pattern
   ========================================================================== */

.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-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-currency-toggle[data-active="usd"] .re-currency-toggle__bg {
    transform: translateX(28px) !important;
}

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

.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-currency-toggle__btn--active {
    color: #FFFFFF !important;
    background: transparent !important;
}

.re-currency-toggle__btn:hover,
.re-currency-toggle__btn:focus,
.re-currency-toggle__btn:active {
    background: transparent !important;
    outline: none !important;
}

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

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

/* ==========================================================================
   Active Filters Section
   ========================================================================== */

.re-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    flex: 1;
    min-width: 0;
    min-height: 36px;
}

/* ==========================================================================
   Filter Tags
   ========================================================================== */

.re-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--re-brand-light);
    border: 1px solid var(--re-brand-primary);
    border-radius: var(--re-radius-lg);
    font-family: inherit;
    font-size: var(--re-font-size-sm);
    font-weight: 500;
    color: var(--re-brand-primary);
    transition: all var(--re-transition-fast);
    max-width: 100%;
}

.re-filter-tag__label {
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.re-filter-tag__remove {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--re-brand-primary);
    color: var(--re-text-white);
    border: none;
    border-radius: var(--re-radius-full);
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    transition: all var(--re-transition-fast);
    flex-shrink: 0;
}

.re-filter-tag__remove:hover {
    transform: scale(1.1);
    background: #6B0F0F;
}

.re-filter-tag__remove:focus-visible {
    outline-offset: 1px;
}

/* Tag animation for removal */
.re-filter-tag--removing {
    transform: scale(0);
    opacity: 0;
}

/* ==========================================================================
   Clear All Button
   ========================================================================== */

.re-clear-all {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--re-border-default);
    border-radius: var(--re-radius-lg);
    font-family: inherit;
    font-size: var(--re-font-size-sm);
    font-weight: 500;
    color: var(--re-text-tertiary);
    cursor: pointer;
    transition: all var(--re-transition-normal);
    white-space: nowrap;
}

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

/* ==========================================================================
   Empty State
   ========================================================================== */

.re-active-filters__empty {
    font-family: inherit;
    font-size: var(--re-font-size-sm);
    color: var(--re-text-tertiary);
    font-style: italic;
}

/* ==========================================================================
   Results Count
   ========================================================================== */

.re-results-count {
    font-family: inherit;
    font-size: var(--re-font-size-sm);
    color: var(--re-text-tertiary);
    white-space: nowrap;
}

.re-results-count__number {
    font-weight: 600;
    color: var(--re-text-primary);
}

/* ==========================================================================
   Sorting Dropdown
   ========================================================================== */

.re-sorting {
    position: relative;
    flex-shrink: 0;
}

/* Sorting Trigger Button */
.re-sorting__trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    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;
    transition: all var(--re-transition-normal);
    white-space: nowrap;
}

.re-sorting__trigger:hover {
    border-color: var(--re-brand-primary);
    color: var(--re-brand-primary);
}

.re-sorting__icon {
    width: 16px;
    height: 16px;
    transition: transform var(--re-transition-normal);
}

.re-sorting--open .re-sorting__icon {
    transform: rotate(180deg);
}

.re-sorting__label {
    line-height: 1;
}

/* Sorting Dropdown Menu */
.re-sorting__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: var(--re-bg-white);
    border: 2px solid var(--re-brand-primary);
    border-radius: var(--re-radius-md);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--re-transition-normal);
    z-index: var(--re-z-dropdown);
    box-shadow: var(--re-shadow-lg);
}

.re-sorting--open .re-sorting__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Sorting Options */
.re-sorting__option {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: var(--re-font-size-sm);
    font-weight: 500;
    color: var(--re-text-primary);
    cursor: pointer;
    border-radius: var(--re-radius-sm);
    transition: all var(--re-transition-fast);
    text-align: left;
}

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

.re-sorting__option--active {
    background: var(--re-brand-primary);
    color: var(--re-text-white);
}

.re-sorting__option--active:hover {
    background: var(--re-brand-hover);
    color: var(--re-text-white);
}

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

@media (max-width: 768px) {
    .re-active-filters-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .re-active-filters {
        order: 2;
    }
    
    .re-sorting {
        order: 1;
        width: 100%;
    }
    
    .re-sorting__trigger {
        width: 100%;
        justify-content: space-between;
    }
    
    .re-sorting__menu {
        left: 0;
        right: 0;
        min-width: 100%;
    }
    
    .re-clear-all {
        width: 100%;
        margin-top: 10px;
        text-align: center;
    }
}

/* ==========================================================================
   Animation States
   ========================================================================== */

.re-filter-tag {
    animation: re-tag-appear 0.2s ease-out;
}

@keyframes re-tag-appear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Staggered removal animation */
.re-filter-tag--removing:nth-child(1) { transition-delay: 0ms; }
.re-filter-tag--removing:nth-child(2) { transition-delay: 50ms; }
.re-filter-tag--removing:nth-child(3) { transition-delay: 100ms; }
.re-filter-tag--removing:nth-child(4) { transition-delay: 150ms; }
.re-filter-tag--removing:nth-child(5) { transition-delay: 200ms; }
