/* HAK İNANÇ · HAK-DNA V4 — Çakışmasız OpenCPN Köprüüstü & Sayısal Kur'an Tasarımı */
:root {
  --bg-abyss: #050b14;
  --bg-bridge: #0a1526;
  --bg-panel: #0f1e36;
  --bg-card: #142847;
  --bg-hover: #1c365e;
  --border: #244069;
  --cyan: #38bdf8;
  --gold: #f59e0b;
  --gold-soft: #fde68a;
  --emerald: #10b981;
  --teal: #14b8a6;
  --purple: #a855f7;
  --pink: #ec4899;
  --text: #ebf3fe;
  --muted: #93abc9;
  --rail-w: 76px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg-abyss);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
}

/* ÇAKIŞMASIZ ANA GRID: Sol OpenCPN Rayı kendi sütunundadır, üst başlığa asla binmez */
.bridge-shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
  padding-bottom: 92px;
  transition: grid-template-columns 0.22s ease;
}
.bridge-shell.rail-expanded { --rail-w: 264px; }

/* SOL OPENCPN İSTASYON RAYI */
.opencpn-rail {
  background: linear-gradient(180deg, #07101e 0%, #0b182e 100%);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: calc(100vh - 92px);
  display: flex;
  flex-direction: column;
  padding: 8px 6px;
  gap: 5px;
  z-index: 300;
  overflow-y: auto;
}

.rail-toggle {
  background: #132744;
  border: 1px solid var(--border);
  color: var(--gold);
  border-radius: 8px;
  padding: 8px 6px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.77rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}
.rail-toggle:hover { border-color: var(--gold); background: #193357; }

.ocpn-btn {
  background: rgba(18, 36, 63, 0.78);
  border: 1px solid rgba(56, 189, 248, 0.16);
  color: var(--text);
  border-radius: 9px;
  padding: 9px 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: all 0.16s ease;
}
.ocpn-btn:hover { background: var(--bg-hover); border-color: var(--cyan); }
.ocpn-btn.active {
  background: linear-gradient(135deg, #1c3860, #132948);
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.38);
}
/* En alt OpenCPN yuvası: 09 Kur'an Matematiği (HAK-DNA) */
.ocpn-btn.dna-slot {
  margin-top: auto;
  background: linear-gradient(135deg, #211545, #0f2c44);
  border: 1px solid #c084fc;
}
.ocpn-btn.dna-slot.active, .ocpn-btn.dna-slot:hover {
  border-color: #f0abfc;
  box-shadow: 0 0 16px rgba(192, 132, 252, 0.42);
}

.ocpn-num {
  min-width: 32px;
  height: 26px;
  border-radius: 6px;
  background: var(--gold);
  color: #060d18;
  font-weight: 800;
  font-size: 0.76rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ocpn-btn.dna-slot .ocpn-num {
  background: linear-gradient(135deg, #e879f9, #38bdf8);
  color: #050b14;
}
.ocpn-label {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: none;
}
.bridge-shell.rail-expanded .ocpn-label { display: inline-block; }

.bridge-shell:not(.rail-expanded) .ocpn-btn:hover::after {
  content: attr(data-tooltip);
  position: fixed;
  left: 82px;
  background: #0c1b33;
  color: #fff;
  border: 1px solid var(--gold);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  z-index: 9500;
  box-shadow: 0 10px 26px rgba(0,0,0,0.72);
  pointer-events: none;
}

/* ANA GÖVDE VE ÜST KOMUTA PANELİ */
.bridge-main { display: flex; flex-direction: column; min-width: 0; }
.bridge-header {
  background: linear-gradient(180deg, #0c1a30 0%, #081222 100%);
  border-bottom: 1px solid var(--border);
  padding: 13px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hdr-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.brand-cluster { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.brand-title { font-size: 1.32rem; font-weight: 800; color: var(--gold); letter-spacing: 0.6px; }
.corpus-pill {
  font-size: 0.76rem;
  padding: 4px 11px;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
  font-weight: 700;
}
.quick-pills { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.q-pill {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.q-pill:hover { border-color: var(--cyan); background: var(--bg-hover); }
.q-pill.gold { background: var(--gold); color: #060d18; border-color: var(--gold); font-weight: 800; }
.q-pill.dna { background: linear-gradient(135deg, rgba(168,85,247,0.3), rgba(56,189,248,0.25)); border-color: #c084fc; color: #f5d0fe; font-weight: 700; }

.lang-strip { display: flex; flex-wrap: wrap; gap: 5px; }
.lang-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0b182c;
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 700;
  cursor: pointer;
}
.lang-btn.active, .lang-btn:hover { background: var(--gold); color: #050b14; border-color: var(--gold); }

.nav-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
input[type="text"], input[type="search"], input[type="number"], select {
  background: #06101e;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 11px;
  border-radius: 7px;
  font-size: 0.85rem;
  outline: none;
}
input:focus, select:focus { border-color: var(--cyan); }

/* İSTASYON GÖRÜNÜMLERİ */
.station-view { display: none; padding: 16px 20px 30px; }
.station-view.active { display: block; }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
}
.panel-dna-hero {
  background: linear-gradient(145deg, #111936 0%, #0b1d36 60%, #0f2537 100%);
  border: 1px solid rgba(192, 132, 252, 0.45);
}
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.panel-head h2 { font-size: 1.08rem; color: var(--gold-soft); }

/* HAK-DNA KONTROL ÇUBUĞU VE RENKLİ SAYISAL KELİMELER */
.dna-controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.ctrl-box {
  background: rgba(5, 11, 20, 0.6);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ctrl-box label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }
.ctrl-box select, .ctrl-box input { width: 100%; }

.dna-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(310px, 1fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 1120px) {
  .dna-layout { grid-template-columns: 1fr; }
}

.dna-verse-row {
  background: rgba(5, 12, 24, 0.86);
  border: 1px solid #253f67;
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.dna-verse-row:hover { border-color: var(--cyan); }
.dna-verse-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--muted);
  margin-bottom: 9px;
}
.dna-ar-sub {
  font-size: 1.22rem;
  color: var(--gold-soft);
  direction: rtl;
  text-align: right;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed rgba(255,255,255,0.08);
}
.dna-tokens-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.dna-tokens-wrap.ltr-flow { direction: ltr; justify-content: flex-start; }
.dna-tokens-wrap.rtl-flow { direction: rtl; justify-content: flex-start; }

.dna-word-pill {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: 'Consolas', 'SFMono-Regular', 'Courier New', monospace;
  font-weight: 800;
  font-size: 0.91rem;
  padding: 6px 10px;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.2);
  transition: transform 0.12s, box-shadow 0.12s;
  letter-spacing: 0.4px;
  user-select: none;
}
.dna-word-pill:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 6px 16px rgba(0,0,0,0.65);
  border-color: #fff !important;
}
.dna-word-pill.selected-pill {
  outline: 2px solid #fff;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.65);
}

/* MATEMATİKSEL ANALİZ KUTULARI */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 9px;
  margin: 10px 0;
}
.stat-box {
  background: rgba(6, 14, 28, 0.82);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
}
.stat-box .st-val { font-size: 1.18rem; font-weight: 800; color: var(--cyan); font-family: 'Consolas', monospace; }
.stat-box .st-lbl { font-size: 0.72rem; color: var(--muted); margin-top: 3px; }

.harmony-card {
  background: linear-gradient(135deg, rgba(17, 36, 64, 0.92), rgba(14, 26, 48, 0.92));
  border: 1px solid #2b4c7c;
  border-left: 4px solid var(--purple);
  border-radius: 10px;
  padding: 13px 15px;
  margin-bottom: 10px;
}
.harmony-card.div19 { border-left-color: var(--emerald); }
.harmony-card.sym { border-left-color: var(--gold); }
.harmony-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.h-type { font-size: 0.73rem; font-weight: 800; text-transform: uppercase; color: #e9d5ff; background: rgba(168,85,247,0.2); padding: 2px 8px; border-radius: 12px; }
.h-coord { font-size: 0.76rem; color: var(--gold); font-weight: 700; }
.h-code {
  font-family: 'Consolas', monospace;
  font-size: 0.88rem;
  color: #6ee7b7;
  background: rgba(5, 11, 20, 0.7);
  padding: 6px 10px;
  border-radius: 6px;
  margin: 6px 0;
  overflow-x: auto;
}

/* 28 HARF DNA ALFABE TABLOSU */
.alpha-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 7px;
}
.alpha-cell {
  background: rgba(6, 13, 25, 0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px;
  text-align: center;
  cursor: pointer;
}
.alpha-cell:hover { border-color: var(--gold); }
.alpha-ar { font-size: 1.35rem; color: var(--gold-soft); font-weight: 700; }
.alpha-id { font-family: 'Consolas', monospace; font-size: 0.82rem; color: var(--cyan); font-weight: 800; }
.alpha-bin { font-family: 'Consolas', monospace; font-size: 0.69rem; color: var(--muted); }
.alpha-cnt { font-size: 0.69rem; color: #6ee7b7; margin-top: 2px; }

/* SURE OKUMA, 3 KİTAP KARŞILAŞTIRMA VE KÖK TABLOSU */
.ayah-stream-box {
  line-height: 2.2;
  font-size: 1.38rem;
  direction: rtl;
  text-align: right;
  background: rgba(6, 13, 24, 0.6);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}
.ayah-unit { padding: 3px 6px; border-radius: 6px; transition: background 0.15s; }
.ayah-unit:hover { background: rgba(56, 189, 248, 0.16); }
.ayah-unit.playing-now { background: rgba(16, 185, 129, 0.28); box-shadow: 0 0 0 1px var(--emerald); }
.ar-word { cursor: pointer; padding: 1px 3px; border-radius: 4px; }
.ar-word:hover { background: rgba(245, 158, 11, 0.3); color: #fff; }

.ayah-row-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.ayah-ar { font-size: 1.4rem; line-height: 2.0; direction: rtl; text-align: right; color: #fff; margin-bottom: 7px; }
.ayah-tr { font-size: 0.94rem; line-height: 1.62; color: #dbeafe; }

.compare-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); gap: 14px; }
.sc-col { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 15px; }
.sc-col.quran { border-top: 4px solid var(--emerald); }
.sc-col.torah { border-top: 4px solid var(--gold); }
.sc-col.nt { border-top: 4px solid var(--cyan); }
.sc-col.apo { border-top: 4px solid var(--purple); }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.topic-chip {
  padding: 6px 13px; border-radius: 18px; border: 1px solid var(--border);
  background: #0c192d; color: var(--muted); font-size: 0.81rem; cursor: pointer;
}
.topic-chip.active, .topic-chip:hover { background: var(--bg-hover); color: #fff; border-color: var(--cyan); }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.84rem; margin-top: 8px; }
.data-table th, .data-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.data-table th { background: #0b182c; color: var(--cyan); }

/* SESSİZ HOVER BALONU (SESİ ASLA KESMEZ!) */
.silent-hover-card {
  position: fixed;
  z-index: 9850;
  max-width: 410px;
  background: rgba(7, 16, 31, 0.98);
  border: 1px solid var(--cyan);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 16px 38px rgba(0,0,0,0.82);
  pointer-events: none;
  display: none;
}
.silent-hover-card .sh-coord { font-size: 0.76rem; font-weight: 800; color: var(--gold); margin-bottom: 5px; display: flex; justify-content: space-between; gap: 8px; }
.silent-hover-card .sh-tr { font-size: 0.88rem; line-height: 1.5; color: #f8fafc; }
.silent-hover-card .sh-dna { margin-top: 7px; padding-top: 7px; border-top: 1px solid rgba(255,255,255,0.12); font-size: 0.76rem; color: #6ee7b7; font-family: 'Consolas', monospace; line-height: 1.45; }

/* KİLİTLİ ARKA PLAN STÜDYO SES KONSOLU */
.master-audio-dock {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 84px;
  background: rgba(6, 13, 25, 0.97);
  border-top: 1px solid var(--gold);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  z-index: 9100;
  backdrop-filter: blur(10px);
}
.dock-info { min-width: 205px; max-width: 300px; }
.dock-title { font-size: 0.87rem; font-weight: 800; color: var(--gold); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-sub { font-size: 0.73rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-controls { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dock-btn {
  background: #142847; color: #fff; border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 12px; cursor: pointer; font-weight: 700; font-size: 0.82rem;
}
.dock-btn.play-main { background: var(--gold); color: #050b14; border-color: var(--gold); }
.dock-seek-area { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 150px; }
.dock-seek-area input[type="range"] { flex: 1; accent-color: var(--gold); cursor: pointer; }

@media (max-width: 860px) {
  .bridge-shell { grid-template-columns: 60px minmax(0, 1fr); padding-bottom: 138px; }
  .master-audio-dock { height: auto; flex-wrap: wrap; padding: 10px 12px; }
}


/* ========================================================================== */
/* HAK-DNA V5 EKLEMELERİ: ÜÇLÜ RENK EŞLEŞMELİ KELİME KARTLARI & BİLİM MATRİSİ */
/* ========================================================================== */

.dna-tri-unit {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-width: 84px;
  max-width: 215px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
  gap: 4px;
  user-select: none;
  vertical-align: top;
}
.dna-tri-unit:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.72);
  border-color: #ffffff !important;
}
.dna-tri-unit.selected-pill {
  outline: 2px solid #ffffff;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.72);
}

.tri-ar {
  font-size: 1.32rem;
  font-weight: 700;
  line-height: 1.45;
  direction: rtl;
  unicode-bidi: isolate;
  text-align: center;
}
.tri-num {
  direction: ltr;
  unicode-bidi: isolate;
  font-family: 'Consolas', 'SFMono-Regular', 'Courier New', monospace;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.4px;
  background: rgba(4, 10, 20, 0.62);
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255,255,255,0.12);
}
.tri-tr {
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 0.77rem;
  font-weight: 700;
  text-align: center;
  line-height: 1.3;
  max-width: 195px;
  word-wrap: break-word;
}

.dna-color-tr-sentence {
  margin-top: 10px;
  padding: 10px 13px;
  border-radius: 8px;
  background: rgba(6, 14, 28, 0.78);
  border-left: 3px solid var(--gold);
  font-size: 0.91rem;
  line-height: 1.65;
  direction: ltr;
  text-align: left;
  color: #e2e8f0;
}

.sci-badge-inline {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.26), rgba(16, 185, 129, 0.26));
  border: 1px solid var(--gold);
  color: #fde68a;
  cursor: pointer;
}

/* PERİYODİK CETVEL, FİZİK VE MATEMATİK KEŞİF KARTLARI */
.science-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(305px, 1fr));
  gap: 13px;
  margin-top: 12px;
}
.sci-card {
  background: linear-gradient(150deg, rgba(16, 33, 58, 0.95), rgba(9, 20, 38, 0.95));
  border: 1px solid #2b4c7e;
  border-top: 3px solid var(--cyan);
  border-radius: 11px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.sci-card:hover {
  transform: translateY(-2px);
  border-color: var(--gold);
}
.sci-card.periodic { border-top-color: var(--gold); }
.sci-card.physics  { border-top-color: var(--cyan); }
.sci-card.math     { border-top-color: var(--purple); }
.sci-card.bio      { border-top-color: var(--emerald); }

.sci-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sci-cat {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
}
.sci-formula {
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  color: #6ee7b7;
  background: rgba(4, 10, 20, 0.78);
  border: 1px solid rgba(110, 231, 183, 0.25);
  padding: 7px 10px;
  border-radius: 7px;
  line-height: 1.45;
}
.sci-desc {
  font-size: 0.82rem;
  line-height: 1.54;
  color: #dbeafe;
}

/* ZENGİNLEŞTİRİLMİŞ HOVER KARTI (GENİŞ AÇIKLAMALI) */
.silent-hover-card {
  max-width: 460px !important;
}
.silent-hover-card .sh-explain {
  margin-top: 7px;
  padding: 7px 9px;
  border-radius: 7px;
  background: rgba(245, 158, 11, 0.13);
  border: 1px solid rgba(245, 158, 11, 0.38);
  font-size: 0.79rem;
  line-height: 1.48;
  color: #fef3c7;
}
