/* ═══════════════════════════════════════════════════
   ZING365 GLOSSARY — Public Stylesheet
   Aligned to Zing365 Design System v2
   ═══════════════════════════════════════════════════ */

:root {
  /* Brand */
  --zing-navy: #0a3250;
  --zing-navy-light: #0d3d62;
  --zing-orange: #ea7726;
  --zing-orange-hover: #d56a1e;
  --zing-orange-glow: rgba(234, 119, 38, 0.15);

  /* Surfaces */
  --zing-bg: #f4f5f7;
  --zing-surface: #ffffff;
  --zing-dark: #0a1f44;
  --zing-border: #e2e8f0;

  /* Text */
  --zing-text: #1a1a2e;
  --zing-text-secondary: #475569;
  --zing-text-muted: #64748b;
  --zing-text-faint: #94a3b8;

  /* Radii */
  --zing-radius-sm: 6px;
  --zing-radius-md: 10px;
  --zing-radius-lg: 14px;
  --zing-radius-pill: 24px;

  /* Shadows */
  --zing-shadow-xs: 0 1px 2px rgba(10, 50, 80, 0.04);
  --zing-shadow-sm: 0 1px 3px rgba(10, 50, 80, 0.06), 0 1px 2px rgba(10, 50, 80, 0.04);
  --zing-shadow-md: 0 4px 12px rgba(10, 50, 80, 0.08), 0 2px 4px rgba(10, 50, 80, 0.04);
  --zing-shadow-lg: 0 12px 36px rgba(10, 50, 80, 0.12), 0 4px 12px rgba(10, 50, 80, 0.06);
  --zing-shadow-xl: 0 20px 48px rgba(10, 50, 80, 0.18);

  /* Motion */
  --zing-ease: cubic-bezier(0.4, 0, 0.2, 1);
  --zing-transition-fast: 0.15s var(--zing-ease);
  --zing-transition: 0.2s var(--zing-ease);
  --zing-transition-slow: 0.3s var(--zing-ease);

  /* Font */
  --zing-font: 'Barlow', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--zing-font); background: var(--zing-bg);
  color: var(--zing-text); min-height: 100vh; -webkit-font-smoothing: antialiased;
}

/* ── Skip link ── */
.skip-link {
  position: absolute; top: -100%; left: 16px; z-index: 9999;
  padding: 8px 16px; background: var(--zing-orange); color: #fff;
  border-radius: var(--zing-radius-sm); font-size: 13px; font-weight: 600;
  text-decoration: none; transition: top var(--zing-transition-fast);
}
.skip-link:focus { top: 8px; }

/* ── Header ── */
.site-header {
  background: linear-gradient(135deg, var(--zing-navy) 0%, var(--zing-navy-light) 50%, var(--zing-navy) 100%);
  background-size: 200% 200%;
  animation: headerShimmer 30s ease infinite;
  padding: 0;
}
@keyframes headerShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between; height: 60px;
}
.header-brand { display: flex; align-items: center; gap: 14px; }
.header-logo { height: 38px; width: auto; display: block; animation: logo-spin 12s linear infinite; }
@keyframes logo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.header-brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-product { color: #fff; font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: -0.01em; }
.header-tagline { color: rgba(255,255,255,0.5); font-size: 13px; margin: 0; line-height: 1.3; }

/* ── App switcher ── */
.app-nav { display: flex; align-items: center; gap: 6px; }
.app-nav a {
  padding: 6px 14px; font-size: 13px; font-weight: 600; text-decoration: none;
  border-radius: var(--zing-radius-pill); transition: all var(--zing-transition-fast);
  letter-spacing: 0.01em;
}
.app-nav a.current { background: rgba(255,255,255,0.12); color: #fff; }
.app-nav a:not(.current) { color: rgba(255,255,255,0.45); }
.app-nav a:not(.current):hover { color: rgba(255,255,255,0.8); background: rgba(255,255,255,0.06); }

/* ── Search ── */
.search-bar-wrap {
  max-width: 1100px; margin: 24px auto 0; padding: 0 24px;
  display: flex; align-items: flex-start; gap: 12px;
}
.search-input-group { flex: 1; }
.search-input {
  width: 100%; padding: 13px 20px; font-size: 16px; font-family: var(--zing-font);
  border: 2px solid var(--zing-border); border-radius: var(--zing-radius-md);
  background: var(--zing-surface); color: var(--zing-text);
  outline: none; transition: border-color var(--zing-transition-fast), box-shadow var(--zing-transition-fast);
  box-shadow: var(--zing-shadow-xs);
}
.search-input:focus {
  border-color: var(--zing-orange);
  box-shadow: 0 0 0 3px var(--zing-orange-glow);
}
.search-input::placeholder { color: var(--zing-text-faint); }
.result-count { display: block; color: var(--zing-text-muted); font-size: 13px; margin-top: 6px; min-height: 20px; }

/* Cross-link hidden — replaced by app-nav in header */
.cross-link { display: none; }

/* ── Category pills ── */
.category-filters {
  max-width: 1100px; margin: 18px auto 0; padding: 0 24px;
  display: flex; flex-wrap: wrap; gap: 8px;
}
.cat-pill {
  padding: 7px 16px; border-radius: var(--zing-radius-pill); font-size: 13px; font-weight: 600;
  cursor: pointer; border: 2px solid currentColor; background: transparent;
  font-family: var(--zing-font); transition: all var(--zing-transition-fast);
}
.cat-pill.active { color: #fff !important; box-shadow: var(--zing-shadow-sm); }
.cat-pill:hover { opacity: 0.85; }

/* ── A-Z navigation ── */
.az-nav {
  max-width: 1100px; margin: 14px auto 0; padding: 0 24px;
  display: flex; flex-wrap: wrap; gap: 4px;
}
.az-btn {
  width: 34px; height: 34px; border-radius: var(--zing-radius-sm);
  border: 1px solid var(--zing-border); background: var(--zing-surface);
  font-family: var(--zing-font); font-weight: 600; font-size: 13px;
  cursor: pointer; color: var(--zing-text); transition: all var(--zing-transition-fast);
}
.az-btn:hover { background: var(--zing-navy); color: #fff; border-color: var(--zing-navy); }
.az-btn.active { background: var(--zing-orange); color: #fff; border-color: var(--zing-orange); box-shadow: var(--zing-shadow-sm); }
.az-btn.empty { opacity: 0.25; cursor: default; }

/* ── Term grid ── */
.main { padding-bottom: 60px; }
.term-list {
  max-width: 1100px; margin: 20px auto 0; padding: 0 24px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px;
}

/* ── Term card ── */
.term-card {
  background: var(--zing-surface); border-radius: var(--zing-radius-md); padding: 20px;
  cursor: pointer; border: 1px solid var(--zing-border);
  transition: all var(--zing-transition); box-shadow: var(--zing-shadow-xs);
}
.term-card:hover {
  border-color: var(--zing-orange);
  box-shadow: var(--zing-shadow-md);
  transform: translateY(-2px);
}
.term-card-name { font-size: 17px; font-weight: 700; color: var(--zing-navy); margin-bottom: 8px; letter-spacing: -0.01em; }
.term-card-cat { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 700; color: #fff; margin-bottom: 10px; }
.term-card-def { font-size: 14px; color: var(--zing-text-muted); line-height: 1.5; }
.fca-badge {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 10px;
  padding: 3px 10px; background: #dcfce7; color: #166534;
  border-radius: var(--zing-radius-md); font-size: 11px; font-weight: 700;
}

/* ── Empty state ── */
.empty-state { max-width: 1100px; margin: 60px auto; padding: 0 24px; text-align: center; color: var(--zing-text-muted); }
.empty-state h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--zing-text-secondary); }

/* ── Term panel ── */
.term-panel {
  position: fixed; top: 0; right: 0; width: 480px; max-width: 100vw; height: 100vh;
  background: var(--zing-surface); z-index: 100; overflow-y: auto;
  transform: translateX(100%); transition: transform var(--zing-transition-slow);
  box-shadow: var(--zing-shadow-xl); padding: 32px 28px;
}
.term-panel.open { transform: translateX(0); }
.panel-backdrop {
  position: fixed; inset: 0; background: rgba(10,31,68,0.5); z-index: 99;
  opacity: 0; pointer-events: none; transition: opacity var(--zing-transition-slow);
}
.panel-backdrop.visible { opacity: 1; pointer-events: all; }
.panel-close {
  position: absolute; top: 16px; right: 16px; background: var(--zing-bg); border: none;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center; color: var(--zing-text-muted);
  transition: all var(--zing-transition-fast);
}
.panel-close:hover { background: var(--zing-border); color: var(--zing-text); }

.panel-term-name { font-size: 26px; font-weight: 700; color: var(--zing-navy); margin-bottom: 10px; margin-top: 20px; letter-spacing: -0.02em; }
.panel-cat-badge { display: inline-block; padding: 4px 14px; border-radius: 14px; font-size: 12px; font-weight: 700; color: #fff; margin-bottom: 16px; }
.panel-fca {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px;
  padding: 4px 12px; background: #dcfce7; color: #166534; border-radius: 14px; font-size: 12px; font-weight: 700;
}
.panel-definition { font-size: 16px; line-height: 1.7; color: var(--zing-text); margin-bottom: 20px; }
.panel-example {
  background: var(--zing-bg); border-left: 4px solid var(--zing-orange);
  padding: 16px 18px; border-radius: 0 var(--zing-radius-md) var(--zing-radius-md) 0;
  font-size: 14px; color: var(--zing-text-secondary); font-style: italic;
  margin-bottom: 24px; line-height: 1.6;
}
.panel-example strong {
  display: block; font-style: normal; font-size: 12px; font-weight: 700;
  color: var(--zing-orange); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.panel-related h4 {
  font-size: 13px; font-weight: 700; color: var(--zing-text-muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px;
}
.related-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.related-pill {
  padding: 7px 16px; border-radius: var(--zing-radius-pill); font-size: 13px; font-weight: 600;
  background: var(--zing-bg); border: 1px solid var(--zing-border);
  cursor: pointer; color: var(--zing-navy);
  transition: all var(--zing-transition-fast); font-family: var(--zing-font);
}
.related-pill:hover { background: var(--zing-navy); color: #fff; border-color: var(--zing-navy); }

/* ── Responsive ── */
@media (max-width: 600px) {
  .header-inner { padding: 0 16px; height: 52px; }
  .header-logo { height: 32px; }
  .brand-product { font-size: 18px; }
  .header-tagline { display: none; }
  .app-nav a { font-size: 12px; padding: 4px 10px; }

  .search-bar-wrap, .category-filters, .az-nav { padding: 0 16px; }
  .term-list { padding: 0 16px; grid-template-columns: 1fr; }
  .term-panel { width: 100vw; }
}
