/* =========================================================
   استایل‌های مدرن، یکپارچه و لوکس منوهای کشویی (Select2)
   طراحی اختصاصی برای سامانه کاروان‌های زیارتی (تم سبز زمردی و طلایی)
   ========================================================= */

.select2-container {
    width: 100% !important;
    text-align: right !important;
    direction: rtl !important;
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
    font-size: 12.5px !important;
    box-sizing: border-box !important;
}

/* فیلد ورودی بسته سلکت (باکس اصلی) */
.select2-container--default .select2-selection--single {
    background-color: #031712 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
    border-radius: 12px !important;
    height: 42px !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 10px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25) !important;
    cursor: pointer !important;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--single:hover {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2), 0 4px 12px rgba(0, 0, 0, 0.35) !important;
}

/* متن گزینه انتخاب‌شده */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #fef08a !important;
    padding-left: 28px !important;
    padding-right: 4px !important;
    line-height: 40px !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 12.5px !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #94a3b8 !important;
    font-weight: 400 !important;
}

/* فلش پیکان بازشونده (سمت چپ در حالت راست‌به‌چپ) */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    width: 26px !important;
    right: auto !important;
    left: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border: none !important;
    width: 8px !important;
    height: 8px !important;
    border-left: 2px solid #f59e0b !important;
    border-bottom: 2px solid #f59e0b !important;
    transform: rotate(-45deg) !important;
    transition: transform 0.25s ease !important;
    margin: 0 !important;
    position: static !important;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    transform: rotate(135deg) !important;
    border-color: #fbbf24 !important;
}

/* دکمه پاک کردن مقدار */
.select2-container--default .select2-selection--single .select2-selection__clear {
    color: #f87171 !important;
    float: left !important;
    font-size: 16px !important;
    margin-left: 18px !important;
    line-height: 40px !important;
    transition: color 0.15s ease !important;
}
.select2-container--default .select2-selection--single .select2-selection__clear:hover {
    color: #ef4444 !important;
}

/* پنل کشویی بازشونده (Dropdown Container) */
.select2-dropdown {
    background: linear-gradient(180deg, #06231c 0%, #031813 100%) !important;
    border: 1.5px solid #d97706 !important;
    border-radius: 14px !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75), 0 0 15px rgba(245, 158, 11, 0.15) !important;
    overflow: hidden !important;
    z-index: 9999999 !important;
    margin-top: 4px !important;
    animation: select2FadeDown 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

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

/* نوار جستجوی داخلی در بالای منو */
.select2-search--dropdown {
    padding: 10px 10px 8px 10px !important;
    background: #02120e !important;
    border-bottom: 1px solid rgba(245, 158, 11, 0.25) !important;
    position: relative !important;
}

.select2-search--dropdown .select2-search__field {
    background-color: #072a21 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 15px 15px !important;
    border: 1px solid rgba(245, 158, 11, 0.4) !important;
    border-radius: 10px !important;
    padding: 8px 34px 8px 12px !important;
    color: #ffffff !important;
    font-family: 'Vazirmatn', Tahoma, sans-serif !important;
    font-size: 12px !important;
    direction: rtl !important;
    text-align: right !important;
    width: 100% !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: all 0.2s ease !important;
}

.select2-search--dropdown .select2-search__field::placeholder {
    color: #94a3b8 !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #fbbf24 !important;
    background-color: #0a3a2e !important;
    box-shadow: 0 0 0 2.5px rgba(251, 191, 36, 0.25) !important;
}

/* لیست اسکرول‌خور گزینه‌ها */
.select2-results__options {
    max-height: 250px !important;
    overflow-y: auto !important;
    padding: 6px !important;
}

/* اسکرول‌بار اختصاصی و باریک برای لیست */
.select2-results__options::-webkit-scrollbar {
    width: 6px !important;
}
.select2-results__options::-webkit-scrollbar-track {
    background: #02120e !important;
    border-radius: 10px !important;
}
.select2-results__options::-webkit-scrollbar-thumb {
    background: #d97706 !important;
    border-radius: 10px !important;
}
.select2-results__options::-webkit-scrollbar-thumb:hover {
    background: #f59e0b !important;
}

/* تک‌تک آیتم‌های منو */
.select2-results__option {
    padding: 9px 12px !important;
    font-size: 12.5px !important;
    color: #e2e8f0 !important;
    border-radius: 8px !important;
    margin-bottom: 3px !important;
    transition: all 0.15s ease !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
}

/* هاور و فوکوس کیبورد روی گزینه */
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.22) 0%, rgba(16, 185, 129, 0.15) 100%) !important;
    color: #fbbf24 !important;
    font-weight: 700 !important;
    padding-right: 14px !important;
}

/* گزینه انتخاب‌شده فعلی */
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #0e4435 !important;
    color: #6ee7b7 !important;
    font-weight: 700 !important;
}
.select2-container--default .select2-results__option[aria-selected=true]::after {
    content: "✓";
    font-weight: 900;
    color: #34d399;
    margin-left: 4px;
}

/* پیام نتیجه‌ای یافت نشد */
.select2-results__message {
    color: #94a3b8 !important;
    text-align: center !important;
    padding: 16px !important;
    font-size: 12px !important;
}

/* =========================================================
   پشتیبانی کامل از حالت روشن (Light Mode) در صورت تغییر تم
   ========================================================= */
html:not(.dark) .select2-container--default .select2-selection--single {
    background-color: #ffffff !important;
    border-color: rgba(217, 119, 6, 0.4) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06) !important;
}

html:not(.dark) .select2-container--default.select2-container--open .select2-selection--single,
html:not(.dark) .select2-container--default .select2-selection--single:focus,
html:not(.dark) .select2-container--default .select2-selection--single:hover {
    border-color: #d97706 !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15) !important;
}

html:not(.dark) .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #0f172a !important;
}

html:not(.dark) .select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-left-color: #b45309 !important;
    border-bottom-color: #b45309 !important;
}

html:not(.dark) .select2-dropdown {
    background: #ffffff !important;
    border-color: #d97706 !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15) !important;
}

html:not(.dark) .select2-search--dropdown {
    background: #f8fafc !important;
    border-bottom-color: #e2e8f0 !important;
}

html:not(.dark) .select2-search--dropdown .select2-search__field {
    background-color: #ffffff !important;
    color: #0f172a !important;
    border-color: #cbd5e1 !important;
}

html:not(.dark) .select2-results__options::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
}

html:not(.dark) .select2-results__option {
    color: #1e293b !important;
}

html:not(.dark) .select2-container--default .select2-results__option--highlighted {
    background: #fef3c7 !important;
    color: #b45309 !important;
}

html:not(.dark) .select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #d1fae5 !important;
    color: #065f46 !important;
}

/* =========================================================
   استایل پشتیبان برای تگ‌های بومی select قبل از اجرای Select2
   ========================================================= */
select:not(.select2-hidden-accessible) {
    background-color: #031712;
    color: #fef08a;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 12px;
}
select:not(.select2-hidden-accessible) option {
    background-color: #06211a;
    color: #ffffff;
}
html:not(.dark) select:not(.select2-hidden-accessible) {
    background-color: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}
html:not(.dark) select:not(.select2-hidden-accessible) option {
    background-color: #ffffff;
    color: #0f172a;
}
