/* =========================================================
   glossary-pages.css — IPTV Ordbog (glossary) styles
   Used by:
     - /ordbog/ (index)
     - /ordbog/<term>/ (20 term pages)
   ========================================================= */

/* ---- Page-level adjustments ---- */
.page-glossary .hero-quick-box {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(99, 102, 241, 0.4);
}

/* ---- Quick definition box (Section 1) ---- */
.quick-def-box {
  background: linear-gradient(135deg, #ecfeff 0%, #e0f2fe 100%);
  border-left: 6px solid #0891b2;
  border-radius: 0 14px 14px 0;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
  box-shadow: 0 4px 12px rgba(8, 145, 178, 0.08);
}

.quick-def-box h3 {
  margin: 0 0 0.85rem;
  font-size: 1.15rem;
  color: #0c4a6e;
  font-weight: 700;
}

.quick-def-box dl {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1rem;
  font-size: 0.95rem;
}

.quick-def-box dt {
  font-weight: 700;
  color: #155e75;
}

.quick-def-box dd {
  margin: 0;
  color: #0f172a;
  line-height: 1.55;
}

/* ---- Code block (e.g. M3U example) ---- */
.code-block {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88rem;
  line-height: 1.7;
  overflow-x: auto;
  border: 1px solid #334155;
}

.code-block .comment { color: #64748b; }
.code-block .keyword { color: #60a5fa; }
.code-block .string  { color: #34d399; }

/* ---- Term-specific table (e.g. bitrate Mbps) ---- */
.term-table-wrapper {
  margin: 1.5rem 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05);
}

.term-table {
  width: 100%;
  border-collapse: collapse;
}

.term-table thead {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
  color: #ffffff;
}

.term-table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.95rem;
}

.term-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #e5e7eb;
  color: #1f2937;
  font-size: 0.95rem;
}

.term-table tr:last-child td { border-bottom: none; }
.term-table tr:nth-child(even) td { background: #f8fafc; }

/* ---- Examples list ---- */
.examples-list {
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
}

.examples-list li {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: 4px solid #6366f1;
  border-radius: 0 10px 10px 0;
  padding: 1rem 1.25rem;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
  line-height: 1.65;
  color: #1e293b;
}

.examples-list li strong { color: #4338ca; }

/* ---- Related terms grid (Section 8) ---- */
.related-terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.related-term-card {
  display: block;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  text-decoration: none;
  color: #0f172a;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.related-term-card:hover {
  border-color: #0891b2;
  box-shadow: 0 8px 20px rgba(8, 145, 178, 0.12);
  transform: translateY(-2px);
}

.related-term-card .rt-name {
  display: block;
  font-weight: 700;
  font-size: 1.05rem;
  color: #0c4a6e;
  margin-bottom: 0.3rem;
}

.related-term-card .rt-desc {
  display: block;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
}

/* ---- Further reading links (Section 9) ---- */
.further-reading {
  background: #f0fdfa;
  border: 1px solid #14b8a6;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.further-reading h3 {
  margin: 0 0 0.75rem;
  color: #115e59;
  font-size: 1.1rem;
  font-weight: 700;
}

.further-reading ul {
  margin: 0;
  padding-left: 1.4rem;
  color: #1f2937;
  line-height: 1.75;
}

.further-reading ul li a {
  color: #0d9488;
  font-weight: 500;
  text-decoration: none;
}

.further-reading ul li a:hover {
  color: #115e59;
  text-decoration: underline;
}

/* =========================================================
   INDEX PAGE STYLES (/ordbog/)
   ========================================================= */

.glossary-search-wrapper {
  margin: 2rem 0 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border: 1px solid #0891b2;
  border-radius: 14px;
}

.glossary-search-wrapper label {
  display: block;
  font-weight: 700;
  color: #0c4a6e;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.glossary-search-input {
  width: 100%;
  padding: 0.85rem 1rem;
  font-size: 1rem;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.glossary-search-input:focus {
  outline: none;
  border-color: #0891b2;
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.15);
}

.glossary-search-stats {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  color: #475569;
}

.glossary-search-stats strong { color: #0891b2; }

/* Alphabetical navigation */
.alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}

.alpha-nav li a {
  display: inline-block;
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  color: #475569;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.alpha-nav li a:hover {
  background: #0891b2;
  color: #ffffff;
  border-color: #0891b2;
}

.alpha-nav li.is-disabled a {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* Term cards grid (index) */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.term-index-card {
  display: block;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 1.5rem;
  text-decoration: none;
  color: #0f172a;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.term-index-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(8, 145, 178, 0.12);
  border-color: #0891b2;
}

.term-index-card .term-emoji {
  display: block;
  font-size: 1.85rem;
  margin-bottom: 0.5rem;
}

.term-index-card .term-name {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: #0c4a6e;
  margin-bottom: 0.4rem;
  letter-spacing: -0.01em;
}

.term-index-card .term-fullname {
  display: block;
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 0.6rem;
  font-style: italic;
}

.term-index-card .term-short {
  display: block;
  font-size: 0.92rem;
  color: #475569;
  line-height: 1.55;
}

.term-index-card .term-link {
  display: inline-block;
  margin-top: 0.85rem;
  color: #0891b2;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Section divider with letter heading */
.alpha-section {
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #0891b2;
}

.alpha-section h2 {
  display: inline-block;
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 800;
  padding: 0.4rem 1.1rem;
  border-radius: 8px;
  margin: 0;
  letter-spacing: 0.04em;
}

/* Popular terms highlight (top section on index) */
.popular-terms-section {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0;
}

.popular-terms-section h2 {
  margin: 0 0 1rem;
  color: #78350f;
  font-size: 1.25rem;
  font-weight: 700;
}

.popular-terms-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.popular-terms-list li a {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #ffffff;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  color: #78350f;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s, color 0.2s;
}

.popular-terms-list li a:hover {
  background: #f59e0b;
  color: #ffffff;
}

/* Empty-search state */
.no-results {
  text-align: center;
  padding: 2rem;
  background: #f8fafc;
  border-radius: 12px;
  color: #64748b;
  font-size: 1rem;
  display: none;
}

.no-results.is-visible { display: block; }

/* Hide cards that don't match search */
.term-index-card.is-hidden { display: none; }

/* Mobile responsive */
@media (max-width: 760px) {
  .terms-grid,
  .related-terms-grid {
    grid-template-columns: 1fr;
  }

  .quick-def-box dl {
    grid-template-columns: 1fr;
    gap: 0.3rem;
  }

  .quick-def-box dt {
    margin-top: 0.5rem;
    font-size: 0.85rem;
  }

  .alpha-nav li a {
    width: 32px;
    height: 32px;
    line-height: 32px;
    font-size: 0.85rem;
  }

  .code-block {
    font-size: 0.78rem;
    padding: 1rem 1.25rem;
  }

  .term-table-wrapper {
    overflow-x: auto;
  }

  .term-table { min-width: 480px; }
}

@media (max-width: 600px) {
  .glossary-search-wrapper { padding: 1.25rem; }
  .term-index-card { padding: 1.25rem; }
  .alpha-section h2 { font-size: 1.15rem; }
}
