/**
 * Vebses Apartments System - Smart Search Widget Styles
 * 
 * Glassmorphism hero search bar
 * 
 * @package VebsesApartments
 * @since 1.0.0
 */

/* ==========================================================================
   FOUC Prevention for Smart Search
   ========================================================================== */

.re-smart-search:not(.re-widget--ready) {
    visibility: hidden;
    opacity: 0;
}

.re-smart-search.re-widget--ready {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.15s ease;
}

/* No JS fallback */
@keyframes re-smart-search-fallback {
    to {
        visibility: visible;
        opacity: 1;
    }
}

.re-smart-search:not(.re-widget--ready) {
    animation: re-smart-search-fallback 0s 0.5s forwards;
}

/* ==========================================================================
   Smart Search Widget Container
   ========================================================================== */

.re-smart-search {
    width: 100%;
    height: 100px;
    background: var(--re-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--re-glass-border);
    border-radius: var(--re-radius-md);
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 30px;
    position: relative;
    font-family: inherit;
}

/* ==========================================================================
   Dividers
   ========================================================================== */

.re-smart-search__divider {
    width: 1px;
    height: 60px;
    background: var(--re-glass-divider);
    flex-shrink: 0;
}

/* ==========================================================================
   Filter Container
   ========================================================================== */

.re-smart-search__filter {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    position: relative;
}

/* Filter Label */
.re-smart-search__label {
    font-family: inherit;
    font-size: var(--re-font-size-sm);
    line-height: 1.15;
    color: var(--re-text-white);
    font-weight: 400;
}

/* ==========================================================================
   Dropdown Trigger
   ========================================================================== */

.re-smart-search__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    position: relative;
    background: transparent;
    border: none;
    padding: 0;
    text-align: left;
}

.re-smart-search__value {
    font-family: inherit;
    font-size: var(--re-font-size-sm);
    line-height: 1.15;
    color: var(--re-text-secondary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.re-smart-search__value--selected {
    color: var(--re-text-white);
}

.re-smart-search__arrow {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    transition: transform var(--re-transition-normal);
    filter: brightness(0) invert(1);
}

.re-smart-search__trigger:hover .re-smart-search__arrow {
    transform: translateX(3px);
}

.re-smart-search__filter--open .re-smart-search__arrow {
    transform: rotate(180deg);
}

/* ==========================================================================
   Range Input Container
   ========================================================================== */

.re-smart-search__range {
    display: flex;
    align-items: center;
    gap: 8px;
}

.re-smart-search__input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: var(--re-font-size-sm);
    line-height: 1.15;
    color: var(--re-text-secondary);
    font-weight: 500;
    width: 100%;
    min-width: 0;
}

.re-smart-search__input::placeholder {
    color: var(--re-text-secondary);
}

.re-smart-search__input:focus {
    color: var(--re-text-white);
}

/* Remove number input spinners */
.re-smart-search__input::-webkit-outer-spin-button,
.re-smart-search__input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.re-smart-search__input[type="number"] {
    -moz-appearance: textfield;
}

.re-smart-search__separator {
    color: var(--re-text-secondary);
    font-size: var(--re-font-size-sm);
    flex-shrink: 0;
}

/* ==========================================================================
   Dropdown Menu
   ========================================================================== */

.re-smart-search__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    min-width: 200px;
    background: #2A2A2A;
    border: 1px solid var(--re-glass-divider);
    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);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-height: 300px;
    overflow-y: auto;
}

.re-smart-search__filter--open .re-smart-search__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.re-smart-search__option:hover {
    background: var(--re-glass-bg);
    color: var(--re-text-white);
}

.re-smart-search__option--selected {
    background: var(--re-brand-secondary);
    color: var(--re-text-white);
}

.re-smart-search__option--selected:hover {
    background: var(--re-brand-hover);
}

/* ==========================================================================
   Search Button
   ========================================================================== */

.re-smart-search__button {
    flex-shrink: 0;
    background: var(--re-brand-secondary);
    border: none;
    border-radius: var(--re-radius-sm);
    padding: 0 32px;
    height: 48px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    color: var(--re-text-white);
    cursor: pointer;
    transition: all var(--re-transition-normal);
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.re-smart-search__button:hover {
    background: var(--re-brand-hover) !important;
    color: var(--re-text-white) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(93, 21, 32, 0.4);
}

.re-smart-search__button:focus {
    background: var(--re-brand-secondary) !important;
    color: var(--re-text-white) !important;
    outline: none;
}

.re-smart-search__button:active {
    background: var(--re-brand-hover) !important;
    color: var(--re-text-white) !important;
    transform: translateY(0);
}

.re-smart-search__button:focus-visible {
    outline-color: var(--re-text-white);
}

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

@media (max-width: 1200px) {
    .re-smart-search {
        height: auto;
        min-height: 100px;
        flex-wrap: wrap;
        padding: 20px 30px;
        gap: 20px;
    }
    
    .re-smart-search__filter {
        flex: 1 1 calc(50% - 10px);
        min-width: 200px;
    }
    
    .re-smart-search__divider {
        display: none;
    }
    
    .re-smart-search__button {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {
    .re-smart-search {
        padding: 20px;
    }
    
    .re-smart-search__filter {
        flex: 1 1 100%;
    }
}

/* ==========================================================================
   Dark Mode Support (when parent has dark background)
   ========================================================================== */

.re-smart-search--light {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

.re-smart-search--light .re-smart-search__label {
    color: var(--re-text-primary);
}

.re-smart-search--light .re-smart-search__value {
    color: var(--re-text-tertiary);
}

.re-smart-search--light .re-smart-search__value--selected {
    color: var(--re-text-primary);
}

.re-smart-search--light .re-smart-search__input {
    color: var(--re-text-tertiary);
}

.re-smart-search--light .re-smart-search__input:focus {
    color: var(--re-text-primary);
}

.re-smart-search--light .re-smart-search__arrow {
    filter: none;
}

.re-smart-search--light .re-smart-search__divider {
    background: rgba(0, 0, 0, 0.1);
}

.re-smart-search--light .re-smart-search__dropdown {
    background: var(--re-bg-white);
    border-color: var(--re-border-default);
    box-shadow: var(--re-shadow-lg);
}

.re-smart-search--light .re-smart-search__option {
    color: var(--re-text-primary);
}

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