/**
 * ================================================================
 * نظام القوائم المنسدلة الموحد - أكاديمية جدير
 * Universal Dropdown & Select System
 * ================================================================
 */

/* 1. Universal Form Select (.form-select-pro & .jadeer-select) */
.form-select-pro,
.jadeer-select,
.select-pro,
select.search-input-pro,
.course-select-box select,
.track-filter-select,
.ans-select {
  height: var(--input-height, 38px) !important;
  min-height: var(--input-height, 38px) !important;
  max-height: var(--input-height, 38px) !important;
  padding: 0 34px 0 12px !important;
  font-family: 'Cairo', sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: var(--text-primary) !important;
  background-color: var(--input-bg, #ffffff) !important;
  border: 1px solid var(--border-medium) !important;
  border-radius: var(--radius-md, 8px) !important;
  cursor: pointer !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-sizing: border-box !important;
  outline: none !important;
  
  /* Custom High-DPI Emerald Down Chevron (RTL Safe) */
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: left 10px center !important;
  background-size: 15px 15px !important;
}

[dir="rtl"] .form-select-pro,
[dir="rtl"] .jadeer-select,
[dir="rtl"] select.search-input-pro,
html[dir="rtl"] .form-select-pro {
  background-position: left 10px center !important;
}

/* Hover & Focus Rings */
.form-select-pro:hover,
.jadeer-select:hover,
select.search-input-pro:hover {
  border-color: var(--accent-emerald) !important;
  background-color: var(--bg-hover) !important;
}

.form-select-pro:focus,
.jadeer-select:focus,
select.search-input-pro:focus {
  border-color: var(--accent-emerald) !important;
  box-shadow: 0 0 0 3px var(--accent-emerald-light, rgba(16, 185, 129, 0.2)) !important;
}

/* Compact Dropdown Variant (For Table Rows & Toolbars) */
.form-select-pro.compact,
.jadeer-select-compact {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  font-size: 0.78rem !important;
  padding: 0 26px 0 8px !important;
  background-size: 12px 12px !important;
  background-position: left 6px center !important;
}

/* 2. Dark Mode Options Uniformity (No blinding white option backgrounds) */
[data-theme="dark"] .form-select-pro,
[data-theme="dark"] .jadeer-select,
[data-theme="dark"] .select-pro,
[data-theme="dark"] select.search-input-pro {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-color: var(--input-bg, #141e32) !important;
  border-color: var(--border-medium, #283a54) !important;
  color: var(--text-primary, #e8edf5) !important;
}

.form-select-pro option,
.jadeer-select option,
.select-pro option,
select.search-input-pro option {
  background: var(--bg-card, #ffffff);
  color: var(--text-primary, #0f172a);
  padding: 8px 12px;
  font-size: 0.86rem;
}

[data-theme="dark"] .form-select-pro option,
[data-theme="dark"] .jadeer-select option,
[data-theme="dark"] .select-pro option,
[data-theme="dark"] select.search-input-pro option {
  background: #111a2e !important;
  color: #e8edf5 !important;
}

/* 3. Global Master Course Switcher (#courseSelect) */
#courseSelect,
.global-course-dropdown {
  height: 36px !important;
  min-height: 36px !important;
  max-height: 36px !important;
  background-color: var(--bg-card) !important;
  border: 1px solid var(--accent-emerald-border, rgba(16, 185, 129, 0.35)) !important;
  border-radius: var(--radius-md, 8px) !important;
  font-weight: 700 !important;
  font-size: 0.84rem !important;
  color: var(--text-primary) !important;
  cursor: pointer !important;
  padding: 0 32px 0 12px !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.2s ease !important;
}

#courseSelect:hover,
.global-course-dropdown:hover {
  border-color: var(--accent-emerald) !important;
  box-shadow: var(--accent-emerald-glow) !important;
}

/* 4. Dropdown Container / Form Group Standard */
.form-group-dropdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group-dropdown label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
}
