/* Hircar — filter form & searchable selects (RTL) */

.filter-form {
    --hc-field-border: #d7dee8;
    --hc-field-border-hover: #a5b4fc;
    --hc-field-border-focus: #6366f1;
    --hc-field-bg: #ffffff;
    --hc-field-bg-soft: #f8fafc;
    --hc-field-text: #1e293b;
    --hc-field-muted: #64748b;
    --hc-field-placeholder: #94a3b8;
    --hc-accent: #4f46e5;
    --hc-accent-soft: #eef2ff;
    --hc-accent-strong: #3730a3;
    --hc-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    --hc-shadow-lg: 0 16px 40px rgba(15, 23, 42, 0.12);
    --hc-radius: 0.875rem;
    --hc-pad-x: 1rem;
    --hc-pad-y: 0.625rem;
}

.filter-form__field {
    min-width: 0;
}

.filter-form .filter-text-input,
.filter-form .filter-submit {
    width: 100%;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
}

.filter-form .filter-text-input {
    min-height: 2.75rem;
    padding: var(--hc-pad-y) var(--hc-pad-x);
    border-radius: var(--hc-radius);
    border: 1px solid var(--hc-field-border);
    background: var(--hc-field-bg);
    color: var(--hc-field-text);
    box-shadow: var(--hc-shadow);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.filter-form .filter-text-input:hover {
    border-color: #c7d2fe;
    background: linear-gradient(180deg, #ffffff 0%, var(--hc-field-bg-soft) 100%);
}

.filter-form .filter-text-input:focus {
    outline: none;
    border-color: var(--hc-field-border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.filter-form .filter-text-input::placeholder {
    color: var(--hc-field-placeholder);
}

.filter-form .filter-text-input[dir="ltr"] {
    text-align: left;
    direction: ltr;
}

.filter-form .filter-submit {
    min-height: 2.75rem;
    padding: var(--hc-pad-y) 1.25rem;
    border: none;
    border-radius: var(--hc-radius);
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 55%, #7c3aed 100%);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.28);
    transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.filter-form .filter-submit:hover {
    filter: brightness(1.03);
    box-shadow: 0 8px 22px rgba(79, 70, 229, 0.34);
}

.filter-form .filter-submit:active {
    transform: translateY(1px);
}

/* Searchable select */
.hc-select {
    position: relative;
    width: 100%;
    font-size: 0.875rem;
}

.hc-select select.js-filter-select-native {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hc-select__trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    min-height: 2.75rem;
    padding: var(--hc-pad-y) var(--hc-pad-x);
    border-radius: var(--hc-radius);
    border: 1px solid var(--hc-field-border);
    background: var(--hc-field-bg);
    color: var(--hc-field-text);
    font-family: inherit;
    font-size: inherit;
    box-shadow: var(--hc-shadow);
    cursor: pointer;
    text-align: right;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.hc-select__trigger:hover {
    border-color: #c7d2fe;
    background: linear-gradient(180deg, #ffffff 0%, var(--hc-field-bg-soft) 100%);
}

.hc-select.is-open .hc-select__trigger,
.hc-select__trigger:focus-visible {
    outline: none;
    border-color: var(--hc-field-border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.hc-select__label {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    color: var(--hc-field-text);
}

.hc-select__label.is-placeholder {
    font-weight: 400;
    color: var(--hc-field-placeholder);
}

.hc-select__icon-wrap {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    color: var(--hc-field-muted);
    transition: transform 0.2s ease, color 0.18s ease;
}

.hc-select__icon {
    width: 1.125rem;
    height: 1.125rem;
}

.hc-select.is-open .hc-select__icon-wrap {
    transform: rotate(180deg);
    color: var(--hc-accent);
}

.hc-select__dropdown {
    position: absolute;
    z-index: 70;
    top: calc(100% + 0.4rem);
    right: 0;
    left: 0;
    display: none;
    overflow: hidden;
    border-radius: var(--hc-radius);
    border: 1px solid #e2e8f0;
    background: #fff;
    box-shadow: var(--hc-shadow-lg);
}

.hc-select.is-open .hc-select__dropdown {
    display: block;
    animation: hc-select-in 0.16s ease;
}

@keyframes hc-select-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hc-select__search-wrap {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
}

.hc-select__search {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.625rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    font-family: inherit;
    font-size: 0.8125rem;
    color: var(--hc-field-text);
    text-align: right;
    direction: rtl;
}

.hc-select__search:focus {
    outline: none;
    border-color: #818cf8;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.hc-select__search::placeholder {
    color: var(--hc-field-placeholder);
}

.hc-select__list {
    list-style: none;
    margin: 0;
    padding: 0.35rem 0;
    max-height: 16rem;
    overflow-y: auto;
}

.hc-select__option {
    padding: 0.6rem 1rem;
    color: var(--hc-field-text);
    cursor: pointer;
    text-align: right;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.hc-select__option:hover,
.hc-select__option.is-focused {
    background: var(--hc-accent-soft);
    color: var(--hc-accent-strong);
}

.hc-select__option.is-selected {
    background: #e0e7ff;
    color: var(--hc-accent-strong);
    font-weight: 600;
}

.hc-select__empty {
    padding: 0.85rem 1rem;
    font-size: 0.8125rem;
    color: var(--hc-field-muted);
    text-align: center;
}
