/* HEADER BLOCK */
/* File: /css/components.css */
/* Purpose: uniform surfaces + correct default/active states + normalized chips/buttons + diagram gallery */

:root {
  /* Optional shared surface tokens (safe fallbacks if not present in global.css) */
  --jc-surface-1: var(--navy-blue-soft);
  --jc-surface-2: rgba(0, 0, 0, 0.22);
  --jc-surface-3: rgba(0, 0, 0, 0.30);

  /* States */
  --jc-control-bg: rgba(255, 255, 255, 0.04);
  --jc-control-border: var(--navy-border-soft);
  --jc-control-text: #f7f9fc;
  --jc-control-text-muted: var(--navy-text-soft);

  --jc-active-bg: var(--navy-gold);
  --jc-active-text: var(--navy-bg);
  --jc-active-border: var(--navy-gold);

  --jc-focus-ring: 0 0 0 2px rgba(255, 255, 255, 0.12), 0 0 0 4px rgba(212, 175, 55, 0.28);
}

/* ---------------------------- */
/* Coming Soon */
/* ---------------------------- */
.coming-soon-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--navy-gold);
  background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), var(--navy-bg));
  color: #f7f9fc;
  font-size: 13px;
  cursor: pointer;
  z-index: 50;
  font-family: "Rajdhani", system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.coming-soon-btn:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22); }

.coming-soon-panel {
  position: fixed;
  top: 52px;
  left: 16px;
  width: 260px;
  max-width: 80vw;
  background: var(--jc-surface-1);
  border-radius: 12px;
  border: 1px solid var(--navy-border-soft);
  padding: 14px 14px 12px;
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  z-index: 40;
  display: none;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6);
}

.coming-soon-panel h3 {
  font-size: 14px;
  margin-bottom: 6px;
  font-family: "Rajdhani", system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--navy-gold);
}

.coming-soon-panel ul {
  margin: 4px 0 0;
  padding-left: 18px;
  color: var(--navy-text-soft);
  font-size: 12px;
}

.coming-soon-panel li { margin-bottom: 4px; }

/* ---------------------------- */
/* Logo */
/* ---------------------------- */
.logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}

.logo-wrap img {
  width: 88px;
  height: 88px;
  object-fit: contain;
}

/* ---------------------------- */
/* Search bar */
/* ---------------------------- */
.search-wrap {
  max-width: 520px;
  margin: 0 auto 28px;
}

.search-inner {
  position: relative;
  border-radius: 999px;
  border: 1px solid var(--navy-border-soft);
  background: var(--jc-surface-2);
  overflow: hidden;
}

.search-inner input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 44px 12px 20px;
  font-size: 14px;
  color: #f7f9fc;
}

.search-inner input::placeholder { color: rgba(247, 249, 252, 0.55); }

.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  pointer-events: none;
  opacity: 0.85;
}

/* ---------------------------- */
/* Category buttons: always horizontal with scroll */
/* IMPORTANT: default = NOT selected */
/* ---------------------------- */
.category-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

.category-buttons::-webkit-scrollbar { height: 4px; }
.category-buttons::-webkit-scrollbar-thumb {
  background: var(--navy-border-soft);
  border-radius: 999px;
}

.category-btn {
  appearance: none;
  -webkit-appearance: none;

  font-family: "Rajdhani", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 13px;
  padding: 10px 26px;
  border-radius: 999px;

  border: 1px solid var(--jc-control-border);
  background: transparent;
  color: var(--jc-control-text);

  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  flex: 0 0 auto;
}

.category-btn:hover {
  border-color: rgba(255, 255, 255, 0.40);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.category-btn:focus-visible {
  outline: none;
  box-shadow: var(--jc-focus-ring);
}

.category-btn.active,
.category-btn[aria-selected="true"],
.category-btn[aria-pressed="true"] {
  background: var(--jc-active-bg);
  color: var(--jc-active-text);
  border-color: var(--jc-active-border);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* Kill any template “always on” styles if present */
.category-btn.selected,
.category-btn.is-selected,
.category-btn.is-active,
.category-btn.current,
.category-btn.on {
  background: transparent;
  color: var(--jc-control-text);
  border-color: var(--jc-control-border);
}

/* ---------------------------- */
/* Chips row */
/* IMPORTANT: default = NOT selected */
/* ---------------------------- */
.chips-strip-wrap { margin-bottom: 16px; }

.chips-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 6px;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.chips-strip::-webkit-scrollbar { height: 4px; }
.chips-strip::-webkit-scrollbar-thumb {
  background: var(--navy-border-soft);
  border-radius: 999px;
}

.chip {
  appearance: none;
  -webkit-appearance: none;

  flex: 0 0 auto;
  border-radius: 999px;

  border: 1px solid var(--jc-control-border);
  padding: 7px 18px;
  font-size: 13px;

  color: var(--jc-control-text-muted);
  background: transparent;

  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.chip:hover { border-color: var(--navy-gold); }

.chip:focus-visible {
  outline: none;
  box-shadow: var(--jc-focus-ring);
}

.chip.active,
.chip[aria-selected="true"],
.chip[aria-pressed="true"] {
  background: var(--jc-active-bg);
  color: var(--jc-active-text);
  border-color: var(--jc-active-border);
}

/* Kill any template “always on” styles if present */
.chip.selected,
.chip.is-selected,
.chip.is-active,
.chip.current,
.chip.on {
  background: transparent;
  color: var(--jc-control-text-muted);
  border-color: var(--jc-control-border);
}

/* ---------------------------- */
/* Topic card */
/* FIX: remove two-tone gradients and unify the surface */
/* ---------------------------- */
.topic-card {
  border-radius: 18px;
  border: 1px solid var(--navy-border-soft);
  background: var(--jc-surface-1);
  padding: 24px 22px 16px;
  box-shadow:
    0 24px 40px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  max-width: 960px;
  margin: 0 auto 24px;
  display: none;
}

.topic-card.visible { display: block; }

.topic-card h2 {
  margin-bottom: 12px;
  letter-spacing: 0.09em;
}

.topic-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--navy-text-soft);
  font-size: 14px;
}

.topic-card li { margin-bottom: 4px; }

.topic-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------------------------- */
/* Buttons */
/* ---------------------------- */
.small-btn {
  appearance: none;
  -webkit-appearance: none;

  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--navy-gold);
  background: transparent;
  color: #f7f9fc;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.small-btn.secondary {
  border-color: var(--navy-border-soft);
  color: var(--navy-text-soft);
}

.small-btn:hover {
  background: var(--navy-gold);
  color: var(--navy-bg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.small-btn:focus-visible {
  outline: none;
  box-shadow: var(--jc-focus-ring);
}

/* ---------------------------- */
/* Feature panel */
/* FIX: uniform surface (no gradients) */
/* ---------------------------- */
.feature-panel {
  margin-top: 24px;
  border-radius: 16px;
  border: 1px solid var(--navy-border-soft);
  background: var(--jc-surface-1);
  padding: 18px 18px 14px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.45);
}

.feature-panel h3 { color: var(--navy-gold); }

/* Study tools grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, auto);
  column-gap: 16px;
  row-gap: 10px;
  margin-top: 10px;
  justify-content: center;
}

.feature-grid button {
  flex: 0 0 auto;
  min-width: 150px;
  text-align: center;
}

/* Feature output window */
/* FIX: uniform surface (no two-tone window) */
.feature-output {
  margin-top: 14px;
  border-radius: 12px;
  border: 1px solid var(--navy-border-soft);
  background: var(--jc-surface-3);
  padding: 12px 14px;
  font-size: 13px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.feature-output h3 {
  margin-bottom: 4px;
  color: var(--navy-gold);
}

.feature-output p,
.feature-output li { font-size: 13px; }

/* Progress list */
.progress-list {
  margin-top: 8px;
  padding-left: 18px;
  font-size: 12px;
  color: var(--navy-text-soft);
}

/* ---------------------------- */
/* Diagram Gallery (swipeable) */
/* ---------------------------- */
.jc-gallery {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.jc-gallery::-webkit-scrollbar { height: 4px; }
.jc-gallery::-webkit-scrollbar-thumb {
  background: var(--navy-border-soft);
  border-radius: 999px;
}

.jc-gallery-item {
  flex: 0 0 85%;
  scroll-snap-align: center;
}

@media (min-width: 920px) {
  .jc-gallery-item { flex-basis: 56%; }
}

.jc-gallery-card {
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.35);
}

.jc-gallery-title {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
  color: #f7f9fc;
}

.jc-gallery-img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  display: block;
}

.jc-gallery-placeholder {
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  opacity: 0.85;
  color: var(--navy-text-soft);
  text-align: center;
  padding: 12px;
}

.jc-gallery-expl {
  margin-top: 10px;
  opacity: 0.92;
  line-height: 1.35;
  color: var(--navy-text-soft);
}

.jc-gallery-controls {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}
/* =========================================================
   HOTFIX: Topic chips row ("white buttons") normalization
   Scope: ONLY buttons/links inside .chips-strip
   ========================================================= */

.chips-strip > button,
.chips-strip > a {
  appearance: none;
  -webkit-appearance: none;

  flex: 0 0 auto;
  border-radius: 999px;

  border: 1px solid var(--jc-control-border);
  padding: 7px 18px;
  font-size: 13px;

  color: var(--jc-control-text-muted);
  background: transparent;

  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;

  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.chips-strip > button:hover,
.chips-strip > a:hover {
  border-color: var(--navy-gold);
}

.chips-strip > button:focus-visible,
.chips-strip > a:focus-visible {
  outline: none;
  box-shadow: var(--jc-focus-ring);
}

.chips-strip > button.active,
.chips-strip > a.active,
.chips-strip > button[aria-selected="true"],
.chips-strip > a[aria-selected="true"],
.chips-strip > button[aria-pressed="true"],
.chips-strip > a[aria-pressed="true"] {
  background: var(--jc-active-bg);
  color: var(--jc-active-text);
  border-color: var(--jc-active-border);
}
/* =========================================================
   Air Force — topic chips visual parity with Math/Inequalities
   Scope: inactive + hover + active (white fill)
   Applies ONLY to Air Force + ONLY to topic chips row
   ========================================================= */

/* Inactive (default): transparent + white text + soft white border */
body[data-branch="airforce"] .chips-strip .chip,
body[data-branch="airforce"] .chips-strip > button,
body[data-branch="airforce"] .chips-strip > a {
  background: transparent;
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

/* Hover: outline lights up, still no fill */
body[data-branch="airforce"] .chips-strip .chip:hover,
body[data-branch="airforce"] .chips-strip > button:hover,
body[data-branch="airforce"] .chips-strip > a:hover {
  border-color: rgba(255, 255, 255, 0.65);
}

/* Active/Selected: WHITE fill + dark text + subtle border */
body[data-branch="airforce"] .chips-strip .chip.active,
body[data-branch="airforce"] .chips-strip > button.active,
body[data-branch="airforce"] .chips-strip > a.active,
body[data-branch="airforce"] .chips-strip .chip[aria-selected="true"],
body[data-branch="airforce"] .chips-strip > button[aria-selected="true"],
body[data-branch="airforce"] .chips-strip > a[aria-selected="true"],
body[data-branch="airforce"] .chips-strip .chip[aria-pressed="true"],
body[data-branch="airforce"] .chips-strip > button[aria-pressed="true"],
body[data-branch="airforce"] .chips-strip > a[aria-pressed="true"] {
  background: #ffffff;
  color: #041525;
  border-color: rgba(255, 255, 255, 0.55);
}