/* Custom select panels for Client service request modal (native <select> list is not styleable) */

#create-account .client-select-native--hidden,
#serviceProviderRequestModal .client-select-native--hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    opacity: 0 !important;
    pointer-events: none !important;
    flex: 0 0 0 !important;
    z-index: -1 !important;
}

.create-account .field:has(.client-custom-select__trigger) {
    cursor: pointer;
}

.create-account .field .img-arrow {
    position: relative;
    z-index: 4;
    pointer-events: auto;
}

.create-account .client-custom-select__trigger {
    position: relative;
    z-index: 3;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 0 4px;
    border: none;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
    font-size: 14px;
    font-family: "IBM Plex Sans Arabic", Helvetica, sans-serif;
    font-weight: 400 !important;
    color: var(--khames-design-system-colors-gray-darkest, #111);
    text-align: start;
    -webkit-appearance: none;
    appearance: none;
}

.create-account .client-custom-select__trigger:focus-visible {
    outline: 2px solid var(--colors-primary-500, #6a5d8b);
    outline-offset: 2px;
    border-radius: 8px;
}

.create-account .client-custom-select__label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: start;
    font-weight: 400 !important;
}

.create-account .client-custom-select__label--placeholder {
    color: var(--khames-design-system-colors-gray-dark, #666);
    font-weight: 400;
}

.client-select-panel {
    display: none;
    position: fixed;
    z-index: 100050;
    margin: 0;
    padding: 8px;
    background: var(--khames-design-system-colors-gray-white, #fff);
    border-radius: 12px;
    border: 1px solid var(--khames-design-system-colors-gray-lighter, #e6e6e6);
    box-shadow:
        0 8px 28px rgba(17, 17, 17, 0.1),
        0 2px 10px rgba(106, 93, 139, 0.12);
    max-height: min(320px, 55vh);
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: #c4bfd4 #f4f3f7;
}

.client-select-panel[hidden] {
    display: none !important;
}

.client-select-panel.is-open {
    display: block !important;
}

.client-select-panel::-webkit-scrollbar {
    width: 6px;
}

.client-select-panel::-webkit-scrollbar-track {
    background: #f4f3f7;
    border-radius: 8px;
    margin: 6px 0;
}

.client-select-panel::-webkit-scrollbar-thumb {
    background: #c4bfd4;
    border-radius: 8px;
}

.client-select-panel::-webkit-scrollbar-thumb:hover {
    background: #a69fb8;
}

.client-select-panel__option {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    background: transparent;
    text-align: start;
    font-size: 15px;
    font-weight: 500;
    font-family: "IBM Plex Sans Arabic", Helvetica, sans-serif;
    color: var(--khames-design-system-colors-gray-darkest, #111);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    box-sizing: border-box;
    overflow-wrap: break-word;
}

.client-select-panel__option--placeholder {
    color: var(--khames-design-system-colors-gray-dark, #999);
    font-weight: 400;
}

.client-select-panel__option:hover,
.client-select-panel__option:focus-visible {
    background: var(--colors-primary-50, #f3f2f6);
    color: var(--colors-primary-500, #6a5d8b);
    outline: none;
}

.client-select-panel__option--active {
    background: #ebe7f5;
    color: var(--colors-primary-500, #6a5d8b);
    font-weight: 600;
}

.client-select-panel__option--active:hover {
    background: #e4ddf3;
}

/* Panel is portaled to <body> with its own dir (see client-custom-select.js) */
.client-select-panel[dir="ltr"] {
    direction: ltr;
    text-align: left;
}

.client-select-panel[dir="ltr"] .client-select-panel__option {
    text-align: left;
    direction: ltr;
}

.client-select-panel[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

.client-select-panel[dir="rtl"] .client-select-panel__option {
    text-align: right;
    direction: rtl;
}

/* Fallback when dir not yet set on panel */
[dir="rtl"] .client-select-panel,
html[dir="rtl"] .client-select-panel {
    direction: rtl;
}

[dir="rtl"] .client-select-panel .client-select-panel__option,
html[dir="rtl"] .client-select-panel .client-select-panel__option {
    text-align: right;
    direction: rtl;
}

[dir="ltr"] .client-select-panel,
html[dir="ltr"] .client-select-panel {
    direction: ltr;
}

[dir="ltr"] .client-select-panel .client-select-panel__option,
html[dir="ltr"] .client-select-panel .client-select-panel__option {
    text-align: left;
    direction: ltr;
}

/* English UI: left-align even when html dir is rtl */
:lang(en) .client-select-panel {
    direction: ltr;
    text-align: left;
}

:lang(en) .client-select-panel .client-select-panel__option {
    text-align: left;
    direction: ltr;
}

/* Arabic UI: right-align even when html dir is ltr */
:lang(ar) .client-select-panel {
    direction: rtl;
    text-align: right;
}

:lang(ar) .client-select-panel .client-select-panel__option {
    text-align: right;
    direction: rtl;
}

:lang(en) .create-account .client-custom-select__trigger,
:lang(en) .create-account .client-custom-select__label,
[dir="ltr"] .create-account .client-custom-select__trigger,
[dir="ltr"] .create-account .client-custom-select__label {
    direction: ltr;
    text-align: left;
}

:lang(ar) .create-account .client-custom-select__trigger,
:lang(ar) .create-account .client-custom-select__label,
[dir="rtl"] .create-account .client-custom-select__trigger,
[dir="rtl"] .create-account .client-custom-select__label {
    direction: rtl;
    text-align: right;
}
