/* ==========================================================================
   TercihÖncesi — Bölüm Sayfası Hızlı Menü (sol taraftaki hamburger rayı)
   --------------------------------------------------------------------------
   Yalnızca bolum/*.html sayfalarına /js/bolum-nav.js tarafından enjekte edilir.
   Tüm seçiciler "#bnav" kimliğiyle kapsanmıştır: site genelindeki
   "nav { ... }" ve "body[data-modern-ui="true"] nav { ... }" gibi kurallar
   (specificity 0,0,1,1) bu bileşeni asla ezemez.
   ========================================================================== */

#bnav {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: center;
  pointer-events: none;
  font-family: 'DM Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#bnav,
#bnav *,
#bnav *::before,
#bnav *::after { box-sizing: border-box; }

/* ---- Karartma katmanı (panel açıkken) ---------------------------------- */
#bnav .bnav-scrim {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.14);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#bnav[data-open="true"] .bnav-scrim {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

[data-theme="dark"] #bnav .bnav-scrim { background: rgba(0, 0, 0, 0.44); }

/* ---- Kapalı durumdaki sol tutamaç ------------------------------------- */
#bnav .bnav-toggle {
  pointer-events: auto;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  width: 36px;
  height: 96px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border, #E2E8F0);
  border-left: none;
  border-radius: 0 15px 15px 0;
  background: var(--glass, rgba(255, 255, 255, 0.82));
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--text-muted, #475569);
  cursor: pointer;
  box-shadow: var(--shadow-md, 0 10px 30px -10px rgba(0, 0, 0, 0.12));
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1), color 0.2s ease,
              background 0.2s ease, box-shadow 0.25s ease,
              opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

#bnav .bnav-toggle:hover {
  width: 45px;
  color: var(--accent, #4F46E5);
  background: var(--surface, #FFFFFF);
  box-shadow: 0 14px 34px -12px rgba(79, 70, 229, 0.5);
}

#bnav .bnav-toggle:focus-visible {
  outline: 2px solid var(--accent, #4F46E5);
  outline-offset: 2px;
}

#bnav .bnav-toggle svg { width: 18px; height: 18px; display: block; flex: 0 0 auto; }

#bnav .bnav-toggle-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
}

#bnav[data-open="true"] .bnav-toggle {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-14px);
}

/* ---- Açılan panel ------------------------------------------------------ */
#bnav .bnav-panel {
  pointer-events: auto;
  position: absolute;
  left: 0;
  right: auto;
  top: 50%;
  bottom: auto;
  width: 294px;
  height: auto;
  max-height: min(80vh, 664px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: 18px 14px 14px;
  border: 1px solid var(--border, #E2E8F0);
  border-left: none;
  border-radius: 0 22px 22px 0;
  background: var(--glass, rgba(255, 255, 255, 0.82));
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 26px 64px -20px rgba(15, 23, 42, 0.34);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-50%) translateX(-104%);
  will-change: transform;
  transition: transform 0.44s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.3s ease, visibility 0.3s ease;
  z-index: 3;
  overflow-x: hidden;
}

#bnav[data-open="true"] .bnav-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* ---- Panel başlığı ---------------------------------------------------- */
#bnav .bnav-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px 13px;
  border-bottom: 1px solid var(--border, #E2E8F0);
}

#bnav .bnav-mark {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  background: linear-gradient(140deg, var(--accent, #4F46E5), #7C3AED);
  color: #fff;
  box-shadow: 0 8px 18px -8px var(--accent, #4F46E5);
}

#bnav .bnav-mark svg { width: 17px; height: 17px; display: block; }

#bnav .bnav-head-title {
  flex: 1 1 auto;
  min-width: 0;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.16rem;
  letter-spacing: 0.13em;
  line-height: 1;
  color: var(--text, #0F172A);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#bnav .bnav-close {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border, #E2E8F0);
  border-radius: 10px;
  background: var(--surface2, #F1F5F9);
  color: var(--text-muted, #475569);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.22s ease;
}

#bnav .bnav-close:hover {
  background: var(--accent, #4F46E5);
  border-color: transparent;
  color: #fff;
  transform: rotate(90deg);
}

#bnav .bnav-close svg { width: 14px; height: 14px; display: block; }

/* ---- Okuma ilerlemesi ------------------------------------------------- */
#bnav .bnav-progress {
  flex: 0 0 auto;
  height: 3px;
  margin: 12px 4px;
  border-radius: 100px;
  background: var(--surface2, #F1F5F9);
  overflow: hidden;
}

#bnav .bnav-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--accent, #4F46E5), var(--accent2, #F59E0B));
  transition: width 0.12s linear;
}

/* ---- Bölüm listesi ---------------------------------------------------- */
#bnav .bnav-list {
  list-style: none;
  margin: 0;
  padding: 2px 0 4px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Firefox */
  scrollbar-width: thin;
  scrollbar-color: rgba(79, 70, 229, 0.55) transparent;
}
[data-theme="dark"] #bnav .bnav-list {
  scrollbar-color: rgba(129, 140, 248, 0.7) transparent;
}

/* WebKit / Blink — site tasarımıyla uyumlu ince accent scrollbar */
#bnav .bnav-list::-webkit-scrollbar { width: 6px; height: 6px; }
#bnav .bnav-list::-webkit-scrollbar-track { background: transparent; }
#bnav .bnav-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent, #4F46E5), #6366F1);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.2s ease;
}
#bnav .bnav-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-hover, #4338CA), var(--accent, #4F46E5));
}
[data-theme="dark"] #bnav .bnav-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #818CF8, var(--accent, #4F46E5));
}

#bnav .bnav-item { margin: 0; padding: 0; }

#bnav .bnav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-muted, #475569);
  font-family: inherit;
  font-size: 0.855rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

#bnav .bnav-link:hover {
  background: var(--surface2, #F1F5F9);
  color: var(--text, #0F172A);
  transform: translateX(3px);
}

#bnav .bnav-link:focus-visible {
  outline: 2px solid var(--accent, #4F46E5);
  outline-offset: -2px;
}

#bnav .bnav-ico {
  flex: 0 0 27px;
  width: 27px;
  height: 27px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--surface2, #F1F5F9);
  color: var(--text-dim, #64748B);
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

#bnav .bnav-ico svg { width: 14px; height: 14px; display: block; }

#bnav .bnav-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#bnav .bnav-link.is-active {
  background: var(--accent-light, rgba(79, 70, 229, 0.10));
  color: var(--accent, #4F46E5);
  font-weight: 700;
}

#bnav .bnav-link.is-active .bnav-ico {
  background: var(--accent, #4F46E5);
  color: #fff;
  box-shadow: 0 6px 14px -6px var(--accent, #4F46E5);
}

#bnav .bnav-link.is-active::before {
  content: '';
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 4px 4px 0;
  background: var(--accent, #4F46E5);
}

/* ---- Panel alt bilgisi ------------------------------------------------ */
#bnav .bnav-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 6px 2px;
  border-top: 1px solid var(--border, #E2E8F0);
  font-size: 0.655rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim, #64748B);
  min-width: 0;
  overflow: hidden;
}

#bnav .bnav-foot svg { width: 12px; height: 12px; display: block; flex: 0 0 auto; }

/* ---- Kaydırma hedefleri için sabit menü payı -------------------------- */
#info-grid-container,
#cost-meter-container,
#faq-section,
#blog-content-body,
#career-container,
#nets-panel,
#yorumlar-container,
#tab-yokatlas,
#similar-departments,
#maas-simulatoru,
.page-hero { scroll-margin-top: 84px; }

/* ==========================================================================
   MOBİL — sol kenarda yuvarlak ikon düğmesi (chat balonu gibi); panel yandan
   çekmece olarak açılır. Dikey "MENÜ" etiketi kaldırıldı: 52 px'lik daire tek
   başına yeterince anlaşılır, klavye gerektirmez, tıklaması kolaydır.
   Sol-alt köşe kullanılmıyor: çerez bandı ve sayfanın kendi mobil menüsü
   orayı kapatıyor.
   ========================================================================== */
@media (max-width: 1100px) {
  #bnav .bnav-toggle {
    width: 52px;
    height: 52px;
    margin-left: 12px;
    border: none;
    border-radius: 50%;
    gap: 0;
    background: linear-gradient(140deg, var(--accent, #4F46E5) 0%, #6366F1 100%);
    color: #fff;
    box-shadow:
      0 12px 28px -10px rgba(79, 70, 229, 0.55),
      0 3px 8px rgba(15, 23, 42, 0.08);
  }

  /* "MENÜ" etiketi mobilde ekrana sığmaz ve görsel olarak da gereksiz;
     erişilebilirlik için sr-only yapısı korunuyor. */
  #bnav .bnav-toggle-label {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    margin: -1px;
    padding: 0;
    border: 0;
  }

  /* Burger ikonu mobilde biraz daha büyük ve daha kalın çizgili */
  #bnav .bnav-toggle svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.4;
  }

  #bnav .bnav-toggle:hover {
    width: 52px;
    color: #fff;
    background: linear-gradient(140deg, var(--accent-hover, #4338CA) 0%, var(--accent, #4F46E5) 100%);
    box-shadow:
      0 16px 32px -10px rgba(79, 70, 229, 0.7),
      0 4px 12px rgba(15, 23, 42, 0.1);
    transform: scale(1.06);
  }

  #bnav .bnav-toggle:active { transform: scale(0.94); }

  /* Panel açıldığında tutamaç yumuşakça kaybolur */
  #bnav[data-open="true"] .bnav-toggle {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-18px) scale(0.85);
  }

  /* ---- Panel: yandan çekmece (tam ekran yükseklik) ---- */
  #bnav .bnav-panel {
    top: 0;
    bottom: 0;
    height: auto;
    width: min(312px, 85vw);
    max-height: none;
    padding: 20px 14px 16px;
    padding-top: max(20px, env(safe-area-inset-top, 0px));
    border-radius: 0 22px 22px 0;
    transform: translateX(-104%);
  }

  #bnav[data-open="true"] .bnav-panel { transform: translateX(0); }

  #bnav .bnav-scrim { background: rgba(15, 23, 42, 0.48); }
  [data-theme="dark"] #bnav .bnav-scrim { background: rgba(0, 0, 0, 0.62); }
}

@media (max-width: 420px) {
  #bnav .bnav-panel { width: 88vw; padding-left: 12px; padding-right: 12px; }
  #bnav .bnav-link { font-size: 0.82rem; padding: 9px 10px; gap: 10px; }
  #bnav .bnav-head-title { font-size: 1.05rem; }
}

/* Panel açıkken mobilde arka plan kaymasın (JS bu sınıfı ekler) */
body.bnav-lock { overflow: hidden; }

/* İlk yükleme anında panel data-open="true" olduğu için transform/opacity
   geçişleri tetiklenmesin — JS iki requestAnimationFrame sonra .bnav-ready
   ekleyerek bu kuralı kaldırır ve sonraki aç/kapa hareketlerini canlandırır. */
#bnav:not(.bnav-ready) .bnav-panel,
#bnav:not(.bnav-ready) .bnav-toggle,
#bnav:not(.bnav-ready) .bnav-scrim { transition: none !important; }

/* ---- Erişilebilirlik / çıktı ------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  #bnav .bnav-toggle,
  #bnav .bnav-panel,
  #bnav .bnav-scrim,
  #bnav .bnav-link,
  #bnav .bnav-ico,
  #bnav .bnav-close,
  #bnav .bnav-progress > span { transition: none !important; }
  #bnav .bnav-link:hover { transform: none; }
}

@media print {
  #bnav { display: none !important; }
}
