/* =========================================================
   Coursaty Custom Select Box Component Styles
   Supports RTL, Searchable Filtering, and Modal Stacking
   ========================================================= */

.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
    direction: rtl;
    text-align: right;
    font-family: inherit;
}

.custom-select-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1rem;
    min-height: 48px;
    border: 2px solid var(--text-lighter, #94a3b8);
    border-radius: 0.5rem;
    background-color: var(--lighter-bg, #ffffff);
    cursor: pointer;
    transition: all 0.25s ease-in-out;
    outline: none;
    box-sizing: border-box;
}

.custom-select-trigger:hover {
    border-color: var(--primary-light, #818cf8);
}

.custom-select-trigger:focus,
.custom-select-trigger.open {
    border-color: var(--primary-color, #6366f1) !important;
    box-shadow: 0 0 0 0.25rem rgba(99, 102, 241, 0.25);
    background-color: #ffffff;
}

.custom-select-trigger .placeholder {
    background-color: transparent !important;
    color: var(--text-dark, #0f172a);
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
    text-align: right;
    line-height: 1.5;
}

.custom-select-trigger .placeholder.is-placeholder,
.custom-select-trigger .placeholder.text-muted {
    color: var(--text-lighter, #94a3b8) !important;
    font-weight: 400;
}

.custom-select-trigger .select-chevron,
.custom-select-trigger i {
    transition: transform 0.25s ease, color 0.25s ease;
    color: var(--text-light, #64748b);
    font-size: 0.85rem;
    margin-right: 10px;
    margin-left: 0;
    flex-shrink: 0;
}

.custom-select-trigger.open .select-chevron,
.custom-select-trigger.open i {
    transform: rotate(180deg);
    color: var(--primary-color, #6366f1);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 1065;
    display: none;
    overflow: hidden;
    animation: customSelectFadeIn 0.18s ease-out;
}

@keyframes customSelectFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-select-options.show {
    display: block !important;
}

.search-box {
    padding: 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    background-color: #f8fafc;
    position: relative;
}

.search-box .search-input {
    padding-left: 34px !important;
    padding-right: 12px !important;
    font-size: 0.875rem !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 0.375rem !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
    height: 36px;
    direction: rtl;
    text-align: right;
}

.search-box .search-input:focus {
    border-color: var(--primary-color, #6366f1) !important;
    box-shadow: 0 0 0 0.15rem rgba(99, 102, 241, 0.15) !important;
}

.search-box i {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-lighter, #94a3b8);
    pointer-events: none;
    font-size: 0.85rem;
}

.options-list {
    max-height: 220px;
    overflow-y: auto;
    padding: 4px 0;
    background-color: #ffffff;
}

/* Scrollbar styling */
.options-list::-webkit-scrollbar {
    width: 6px;
}

.options-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.options-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.options-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.option {
    padding: 9px 15px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    color: var(--text-dark, #0f172a);
    font-size: 0.925rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.option:hover,
.option.highlighted {
    background-color: #f1f5f9;
    color: var(--primary-color, #6366f1);
}

.option.selected {
    background-color: var(--primary-color, #6366f1) !important;
    color: #ffffff !important;
    font-weight: 600;
}

.option.selected:hover {
    background-color: var(--primary-dark, #4f46e5) !important;
    color: #ffffff !important;
}

.no-results {
    padding: 12px 15px;
    text-align: center;
    color: var(--text-lighter, #94a3b8);
    font-size: 0.875rem;
}
