/* ============================================================
   Sanoop Balan — Glossary Specific Stylesheet
   ============================================================ */

:root {
  --g-purple: #a56ef4;
  
  /* Tint fills behind icons / badge blocks */
  --tint-blue: rgba(66, 133, 244, 0.12);
  --tint-red: rgba(234, 67, 53, 0.12);
  --tint-yellow: rgba(251, 188, 5, 0.12);
  --tint-green: rgba(52, 168, 83, 0.12);
  --tint-purple: rgba(165, 110, 244, 0.12);

  /* Lighter text variants readable on dark surfaces */
  --on-blue: #74b0ff;
  --on-red: #f7867e;
  --on-yellow: #fdd97b;
  --on-green: #7feaa5;
  --on-purple: #c4a0f7;
  
  --border-dashed: rgba(255, 255, 255, 0.12);
}

/* Light mode overrides for text color contrast */
html.light {
  --tint-blue: rgba(66, 133, 244, 0.08);
  --tint-red: rgba(234, 67, 53, 0.08);
  --tint-yellow: rgba(251, 188, 5, 0.08);
  --tint-green: rgba(52, 168, 83, 0.08);
  --tint-purple: rgba(165, 110, 244, 0.08);

  --on-blue: #1a73e8;
  --on-red: #d93025;
  --on-yellow: #b06000;
  --on-green: #137333;
  --on-purple: #7c3aed;
  
  --border-dashed: rgba(0, 0, 0, 0.12);
}

/* ── GLOSSARY LAYOUT ── */

.glossary-wrapper {
  max-width: 1440px;
  margin: 120px auto 60px;
  padding: 0 5%;
}

.glossary-header {
  margin-bottom: 40px;
}

.glossary-header h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 18px 0 14px;
}

.glossary-header p {
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 300;
  max-width: 760px;
  line-height: 1.75;
}

/* Stats Row */
.glossary-stats {
  display: flex;
  gap: 40px;
  margin-top: 28px;
}

.glossary-stat-item {
  display: flex;
  flex-direction: column;
}

.glossary-stat-val {
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1;
}

.glossary-stat-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}

/* ── TOOLBAR & FILTERS ── */

.glossary-toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  position: relative;
}

.glossary-search {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 16px;
  flex: 1;
  min-width: 220px;
}

.glossary-search span {
  font-size: 0.9rem;
  opacity: 0.7;
}

.glossary-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
  width: 100%;
}

.glossary-filter-group {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
}

.glossary-filter-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-family: var(--font);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.glossary-filter-btn:hover {
  opacity: 0.85;
}

.glossary-filter-btn.active {
  background: var(--text);
  color: var(--bg);
}

.glossary-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
}

@media (max-width: 768px) {
  .glossary-divider {
    display: none;
  }
}

/* ── PILLAR TABS ── */

.pillar-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .pillar-tabs {
    overflow-x: auto;
    padding-bottom: 8px;
  }
}

.pillar-tab-btn {
  flex: 1;
  text-align: left;
  cursor: pointer;
  font-family: var(--font);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.3s var(--ease-out);
  min-width: 200px;
}

.pillar-tab-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pillar-tab-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.pillar-tab-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.pillar-tab-count {
  font-size: 0.75rem;
  color: var(--muted);
}

.pillar-tab-desc {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 300;
}

/* Pillar active tab configurations */
.pillar-tab-btn[data-pillar="seo"].active {
  background: var(--tint-blue);
  border-color: rgba(66, 133, 244, 0.3);
}
.pillar-tab-btn[data-pillar="aeo"].active {
  background: var(--tint-purple);
  border-color: rgba(165, 110, 244, 0.3);
}
.pillar-tab-btn[data-pillar="geo"].active {
  background: var(--tint-green);
  border-color: rgba(52, 168, 83, 0.3);
}

/* ── CATEGORY JUMP NAV ── */

.category-jump-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  animation: fadeUp 0.5s ease both;
}

.jump-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.jump-link:hover {
  border-color: var(--border2);
  color: var(--text);
}

.jump-link span {
  color: var(--text);
  font-weight: 600;
}

/* Pillar Intro Banner */
.pillar-intro-banner {
  padding: 20px 24px;
  border-radius: 12px;
  margin-bottom: 28px;
  animation: fadeUp 0.5s 0.1s ease both;
}

.pillar-intro-banner[data-pillar-theme="seo"] {
  background: var(--tint-blue);
  border-left: 3px solid var(--g-blue);
}
.pillar-intro-banner[data-pillar-theme="aeo"] {
  background: var(--tint-purple);
  border-left: 3px solid var(--g-purple);
}
.pillar-intro-banner[data-pillar-theme="geo"] {
  background: var(--tint-green);
  border-left: 3px solid var(--g-green);
}

.pillar-intro-banner p {
  margin: 0;
  font-weight: 300;
  color: var(--text);
  line-height: 1.7;
  font-size: 0.94rem;
  font-style: italic;
}

.pillar-intro-banner span {
  font-style: normal;
  color: var(--muted);
  font-size: 0.8rem;
}

/* ── TERM VIEWS (GRID / LIST) ── */

.pillar-container {
  display: none;
}

.pillar-container.active {
  display: block;
}

.category-section {
  margin-top: 36px;
  scroll-margin-top: 90px;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  gap: 16px;
  flex-wrap: wrap;
}

.category-header h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.category-header .stats-badge {
  font-size: 0.76rem;
  color: var(--muted);
  white-space: nowrap;
}

.category-desc {
  color: var(--muted);
  font-weight: 300;
  max-width: 760px;
  margin: 0 0 16px;
  font-size: 0.9rem;
  line-height: 1.6;
}

/* Grid layout for terms */
.terms-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.term-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.term-chip:hover {
  transform: translateY(-2px);
  border-color: var(--border2);
}

.term-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.term-dot.level-beginner { background: var(--g-green); }
.term-dot.level-intermediate { background: var(--g-yellow); }
.term-dot.level-advanced { background: var(--g-red); }

/* List layout for terms */
.terms-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.term-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  text-decoration: none;
  transition: padding-left 0.2s ease, border-color 0.2s ease;
}

.term-list-item:hover {
  padding-left: 8px;
  border-bottom-color: var(--border2);
}

.term-list-item-level {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Blog Recommendation Box */
.category-blog-box {
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.category-blog-box span {
  font-size: 0.82rem;
  color: var(--muted);
}

.category-blog-box span strong {
  color: var(--text);
  font-weight: 600;
}

.category-blog-box a {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.2s;
}

.category-blog-box a:hover {
  transform: translateX(3px);
}

/* ── A-Z BROWSE VIEW ── */

.az-container {
  display: none;
  margin-top: 36px;
  columns: 2;
  column-gap: 48px;
  animation: fadeUp 0.5s ease both;
}

@media (max-width: 768px) {
  .az-container {
    columns: 1;
  }
}

.az-group {
  break-inside: avoid;
  margin-bottom: 24px;
}

.az-letter {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--g-blue);
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 4px;
}

.az-term-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 0.86rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.az-term-link:hover {
  padding-left: 4px;
  border-bottom-color: var(--border2);
}

.az-term-meta {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── TERM DETAIL PAGE SPECIFICS ── */

.term-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 48px;
  margin-top: 24px;
}

@media (max-width: 992px) {
  .term-detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

.term-breadcrumbs {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.term-breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.term-breadcrumbs a:hover {
  color: var(--text);
}

.term-meta-badges {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.term-header h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 8px;
  color: var(--text);
}

.term-alias {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 28px;
}

.term-definition {
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.75;
  color: var(--text);
  max-width: 640px;
  margin: 0 0 24px;
}

.term-tip-box {
  padding: 20px 24px;
  background: var(--tint-yellow);
  border-left: 3px solid var(--g-yellow);
  border-radius: 12px;
  margin-bottom: 28px;
}

.term-tip-box p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 300;
  line-height: 1.7;
  color: var(--text);
}

.term-tip-box p strong {
  font-weight: 700;
}

.term-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
}

/* Related blog layout in sidebar */
.term-blog-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.term-blog-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.term-blog-card h4 {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  margin-bottom: 8px;
}

.term-blog-card p {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--muted);
  line-height: 1.65;
}

.term-blog-card a {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
}

/* Sidebar boxes */
.term-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 48px;
}

.sidebar-box {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.sidebar-box-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 14px;
}

.sidebar-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sidebar-chip {
  padding: 8px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text);
  text-decoration: none;
  transition: all 0.2s;
}

.sidebar-chip:hover {
  border-color: var(--border2);
  background: var(--surface3);
}

.sidebar-box-link {
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: transform 0.2s;
}

.sidebar-box-link:hover {
  transform: translateX(3px);
}

.sidebar-audit-box {
  text-align: center;
}

.sidebar-audit-box h4 {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  margin-bottom: 6px;
}

.sidebar-audit-box p {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 16px;
}

/* Badge classes */
.badge-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-pill.badge-seo { background: var(--tint-blue); color: var(--on-blue); border: 1px solid rgba(66, 133, 244, 0.2); }
.badge-pill.badge-aeo { background: var(--tint-purple); color: var(--on-purple); border: 1px solid rgba(165, 110, 244, 0.2); }
.badge-pill.badge-geo { background: var(--tint-green); color: var(--on-green); border: 1px solid rgba(52, 168, 83, 0.2); }

.badge-pill.badge-beginner { background: rgba(52, 168, 83, 0.1); color: var(--on-green); border: 1px solid rgba(52, 168, 83, 0.15); }
.badge-pill.badge-intermediate { background: rgba(251, 188, 5, 0.1); color: var(--on-yellow); border: 1px solid rgba(251, 188, 5, 0.15); }
.badge-pill.badge-advanced { background: rgba(234, 67, 53, 0.1); color: var(--on-red); border: 1px solid rgba(234, 67, 53, 0.15); }
