/* =========================================================
   ZAR AI v2 — MODEL SELECTOR
   The only architecture-level control surfaced to the user.
   "Mistral · Mistral-7B ▾" opening a small listbox with one
   real, available entry and one clearly-disabled future entry.
========================================================= */

.zar-v2-model {
  position: relative;
}

.zar-v2-model__trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--zar-v2-space-2);

  padding: var(--zar-v2-space-2) var(--zar-v2-space-3);
  border-radius: var(--zar-v2-radius-pill);
  border: 1px solid var(--zar-v2-border-subtle);
  background: var(--zar-v2-bg-surface);
  color: var(--zar-v2-text-primary);

  font-size: var(--zar-v2-font-size-xs);
  font-weight: var(--zar-v2-font-weight-semibold);
  white-space: nowrap;

  transition: border-color var(--zar-v2-duration-fast) var(--zar-v2-ease-standard);
}
.zar-v2-model__trigger:hover,
.zar-v2-model[data-open="true"] .zar-v2-model__trigger {
  border-color: var(--zar-v2-border-strong);
}

.zar-v2-model__dot {
  width: 6px;
  height: 6px;
  border-radius: var(--zar-v2-radius-circle);
  background: var(--zar-v2-state-success);
  flex: 0 0 auto;
}

.zar-v2-model__provider {
  color: var(--zar-v2-text-muted);
  font-weight: var(--zar-v2-font-weight-medium);
}

/* Icon-only fallback for narrow viewports (see layout/responsive.css)
   — hidden by default; .zar-v2-model__label carries the full visible
   "Mistral · Mistral-7B" text by default and is what the mobile rule
   hides instead. The trigger's own aria-label keeps the accessible
   name in both states. */
.zar-v2-model__icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--zar-v2-radius-circle);
  background: var(--zar-v2-accent-soft);
  color: var(--zar-v2-accent);
  font-size: 0.65rem;
  font-weight: var(--zar-v2-font-weight-bold);
  flex: 0 0 auto;
}

.zar-v2-model__chevron {
  width: 12px;
  height: 12px;
  color: var(--zar-v2-text-muted);
  transition: transform var(--zar-v2-duration-fast) var(--zar-v2-ease-standard);
}
.zar-v2-model[data-open="true"] .zar-v2-model__chevron { transform: rotate(180deg); }

.zar-v2-model__menu {
  position: absolute;
  top: calc(100% + var(--zar-v2-space-2));
  left: 0;
  z-index: var(--zar-v2-z-dropdown);

  min-width: 258px;
  padding: var(--zar-v2-space-2);
  border-radius: var(--zar-v2-radius-md);
  border: 1px solid var(--zar-v2-border-strong);
  background: var(--zar-v2-bg-surface-raised);
  box-shadow: var(--zar-v2-shadow-popover);

  display: grid;
  gap: var(--zar-v2-space-1);
}

.zar-v2-model__option {
  display: flex;
  align-items: flex-start;
  gap: var(--zar-v2-space-2);
  width: 100%;
  padding: var(--zar-v2-space-2) var(--zar-v2-space-3);
  border-radius: var(--zar-v2-radius-sm);
  text-align: left;
}

.zar-v2-model__option:not([aria-disabled="true"]):hover,
.zar-v2-model__option:not([aria-disabled="true"]):focus-visible {
  background: var(--zar-v2-accent-soft);
}

.zar-v2-model__option-check {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--zar-v2-state-success);
}

.zar-v2-model__option-body strong {
  display: block;
  font-size: var(--zar-v2-font-size-sm);
  font-weight: var(--zar-v2-font-weight-semibold);
  color: var(--zar-v2-text-primary);
}

.zar-v2-model__option-body span {
  display: block;
  font-size: var(--zar-v2-font-size-xs);
  color: var(--zar-v2-text-muted);
  margin-top: 1px;
}

.zar-v2-model__option[aria-disabled="true"] {
  cursor: not-allowed;
}
.zar-v2-model__option[aria-disabled="true"] .zar-v2-model__option-body strong {
  color: var(--zar-v2-text-muted);
}
.zar-v2-model__option[aria-disabled="true"] .zar-v2-model__option-check {
  color: var(--zar-v2-text-muted);
  opacity: 0.5;
}

.zar-v2-model__soon {
  margin-left: auto;
  align-self: center;
  padding: 2px 8px;
  border-radius: var(--zar-v2-radius-pill);
  border: 1px solid var(--zar-v2-border-subtle);
  font-size: 0.65rem;
  font-weight: var(--zar-v2-font-weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--zar-v2-text-muted);
  white-space: nowrap;
}

.zar-v2-model__menu[hidden] { display: none; }
