/* Local Vazirmatn — no CDN */
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/vazirmatn/Vazirmatn-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/vazirmatn/Vazirmatn-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/vazirmatn/Vazirmatn-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Vazirmatn';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/vazirmatn/Vazirmatn-Bold.woff2') format('woff2');
}

/* Beautiful selects — base; theme.css refines colors */
select,
.select-pretty {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: var(--input-bg, rgba(15, 23, 42, 0.72));
  background-image:
    linear-gradient(45deg, transparent 50%, #94a3b8 50%),
    linear-gradient(135deg, #94a3b8 50%, transparent 50%),
    linear-gradient(to right, rgba(79, 94, 232, 0.35), rgba(79, 94, 232, 0.35));
  background-position:
    calc(100% - 18px) calc(50% - 3px),
    calc(100% - 12px) calc(50% - 3px),
    calc(100% - 2.6rem) 50%;
  background-size: 6px 6px, 6px 6px, 1px 60%;
  background-repeat: no-repeat;
  border: 1px solid var(--border-strong, rgba(51, 65, 85, 0.65));
  border-radius: 0.85rem;
  color: var(--text-strong, #f1f5f9);
  padding: 0.65rem 2.75rem 0.65rem 0.9rem;
  font-family: 'Vazirmatn', sans-serif;
  font-size: 0.875rem;
  line-height: 1.4;
  min-height: 2.6rem;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

select:hover,
.select-pretty:hover {
  border-color: rgba(129, 140, 248, 0.55);
}

select:focus,
.select-pretty:focus {
  outline: none;
  border-color: #4F5EE8;
  box-shadow: 0 0 0 3px rgba(79, 94, 232, 0.22);
}

select:disabled,
.select-pretty:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

select option,
.select-pretty option {
  background: var(--surface-elevated, #0f172a);
  color: var(--text, #e2e8f0);
  padding: 0.5rem;
}

/* compact variant used in tight toolbars */
select.select-sm {
  min-height: 2.1rem;
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
  padding-inline-start: 0.7rem;
  padding-inline-end: 2.4rem;
  font-size: 0.75rem;
  border-radius: 0.65rem;
  background-position:
    calc(100% - 14px) calc(50% - 2px),
    calc(100% - 9px) calc(50% - 2px),
    calc(100% - 2.1rem) 50%;
}

/* Choices.js — theme-aware (RTL-friendly) */
.q-choices {
  margin-bottom: 0;
  font-family: 'Vazirmatn', sans-serif;
  direction: rtl;
  text-align: right;
  overflow: visible !important;
}
.q-choices.is-open { overflow: visible !important; }
.q-choices .choices__inner {
  background: var(--input-bg, rgba(15, 23, 42, 0.85));
  border: 1px solid var(--border-strong, rgba(51, 65, 85, 0.65));
  border-radius: 0.85rem;
  min-height: 2.6rem;
  padding: 0.45rem 2.25rem 0.45rem 0.75rem;
  font-size: 0.875rem;
  color: var(--text-strong, #f1f5f9);
  display: flex;
  align-items: center;
  direction: rtl;
  text-align: right;
  overflow: hidden;
}
.q-choices.q-choices-sm .choices__inner {
  min-height: 2.1rem;
  font-size: 0.75rem;
  border-radius: 0.65rem;
}
.q-choices.is-open .choices__inner,
.q-choices.is-focused .choices__inner {
  border-color: #4F5EE8;
  box-shadow: 0 0 0 3px rgba(79, 94, 232, 0.22);
}
.q-choices .choices__list {
  direction: rtl;
  text-align: right;
}
.q-choices .choices__list--single {
  width: 100%;
  padding: 0;
  display: block;
}
.q-choices .choices__list--single .choices__item {
  display: block;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: keep-all;
  overflow-wrap: normal;
  letter-spacing: normal;
  direction: rtl;
  text-align: right;
  line-height: 1.5;
  padding: 0;
}
.q-choices .choices__list--dropdown,
.q-choices .choices__list[aria-expanded] {
  background: var(--surface-elevated, #1a1f2e);
  border: 1px solid var(--border-strong, rgba(51, 65, 85, 0.8));
  border-radius: 0.75rem;
  margin-top: 4px;
  z-index: 9999;
  direction: rtl;
  text-align: right;
  min-width: 100%;
  width: 100%;
  max-height: 16rem;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}
.q-choices .choices__list--dropdown .choices__item,
.q-choices .choices__list[aria-expanded] .choices__item {
  color: var(--text, #e2e8f0);
  font-size: 0.875rem;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  direction: rtl;
  text-align: right;
  line-height: 1.6;
  padding: 0.55rem 0.85rem;
}
.q-choices .choices__list--dropdown .choices__item--selectable.is-highlighted,
.q-choices .choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background: rgba(79, 94, 232, 0.25);
}
.q-choices .choices__input {
  background: transparent;
  color: var(--text-strong, #f1f5f9);
  margin-bottom: 0;
  direction: rtl;
  text-align: right;
}
.q-choices .choices__placeholder { opacity: 0.55; }
.q-choices[data-type*=select-one]::after {
  border-color: #94a3b8 transparent transparent;
  margin-top: -2px;
  left: 0.85rem;
  right: auto;
}
.q-choices[data-type*=select-one].is-open::after {
  border-color: transparent transparent #94a3b8;
  margin-top: -8px;
}
.q-choices[data-type*=select-one] .choices__inner {
  padding-left: 2.25rem;
  padding-right: 0.75rem;
}
