/* Общие стили переключателя темы и единой тёмной темы (Android Dark) */

.header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1px solid var(--outline, #dadce0);
  background: var(--surface-tint, #f1f3f4);
  color: var(--ink, #202124);
  font-family: var(--font-display, 'Roboto', sans-serif);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.theme-toggle:hover {
  background: var(--surface-mint, #e6f4ea);
  border-color: var(--android-green-border, #81c995);
  color: var(--android-green-ink, #0d652d);
}

.theme-toggle:active {
  transform: scale(0.97);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--android-green, #3ddc84);
  outline-offset: 2px;
}

.theme-toggle-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

html[data-theme="dark"] .theme-toggle-icon-sun {
  color: #fdd663;
}

html[data-theme="dark"] .theme-toggle:hover .theme-toggle-icon-sun {
  color: currentColor;
}

@media (max-width: 720px) {
  .theme-toggle {
    width: 36px;
    padding: 0;
  }
  .theme-toggle-text {
    display: none;
  }
}

/* ==================== ЕДИНАЯ ТЁМНАЯ ТЕМА (ANDROID DARK) ==================== */
html[data-theme="dark"] {
  --surface: #12171e;
  --surface-variant: #19212b;
  --surface-tint: #212b38;
  --surface-mint: rgba(61, 220, 132, 0.14);
  --surface-blue: rgba(138, 180, 248, 0.14);
  --surface-warn: rgba(253, 214, 99, 0.12);
  --surface-err: rgba(242, 139, 130, 0.14);
  --android-green: #3ddc84;
  --android-green-hover: #53e494;
  --android-green-ink: #6ee7a8;
  --android-green-border: rgba(61, 220, 132, 0.36);
  --ink: #e8eaed;
  --ink-secondary: #9aa0a6;
  --blue-ink: #8ab4f8;
  --blue-border: rgba(138, 180, 248, 0.34);
  --blue-callout-ink: #aecbfa;
  --warn-ink: #fdd663;
  --warn-border: rgba(253, 214, 99, 0.34);
  --err-ink: #f28b82;
  --err-border: rgba(242, 139, 130, 0.36);
  --outline: #2d3744;
  --outline-light: #222a35;

  /* Семантические токены */
  --header-bg: rgba(18, 23, 30, 0.92);
  --quiz-canvas: #0c1015;
  --card-shadow: 0 4px 22px rgba(0, 0, 0, 0.42);
  --modal-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  --btn-primary-bg: #3ddc84;
  --btn-primary-hover: #53e494;
  --btn-primary-ink: #073042;
  --card-hover-border: #3ddc84;
  --focus-border: #3ddc84;
  --focus-ring: 0 0 0 3px rgba(61, 220, 132, 0.18);
  --code-surface: #0a141d;
  --code-border: #22303e;
  --inline-code-ink: #8ab4f8;
  --heading-accent: #e8eaed;
  --pill-navy-bg: rgba(61, 220, 132, 0.16);
  --pill-navy-ink: #6ee7a8;
  --pill-navy-border: rgba(61, 220, 132, 0.34);
  --tab-active-bg: #2c3848;
  --tab-active-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  --overlay-bg: rgba(6, 10, 14, 0.88);
  --watermark-ink: rgba(232, 234, 237, 0.045);
}
