/**
 * KAYA ONE X — Evrensel Kuantum Sol Menü (Sidebar) & Overlap Koruması
 * Kuantum Mat Cam (Glassmorphism) Dikey Navigasyon
 */

:root {
  --sidebar-width: 85px;
  --sidebar-spacing: 100px;
}

/* OVERLAP (ÜSTE BİNME) KESİN ÇÖZÜMÜ:
   Sol menü 85px olduğundan, tüm panellerin gövdesi soldan 100px güvenli boşluk alır. */
body {
  padding-left: 100px !important;
  padding-bottom: 0 !important;
  box-sizing: border-box !important;
}

body:has(.rail) {
  padding-left: 0 !important;
}

.kaya-global-nav {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 85px;
  z-index: 9999;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: rgba(3, 8, 23, 0.94);
  border-right: 1px solid rgba(87, 121, 217, 0.28);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.65), inset -1px 0 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 6px;
  gap: 10px;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  overflow-y: auto;
  overflow-x: hidden;
}

.kaya-global-nav .nav-brand {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #2d55c7, #102c61);
  border: 1px solid rgba(111, 154, 255, 0.4);
  box-shadow: 0 0 24px rgba(45, 85, 199, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-weight: 950;
  font-size: 16px;
  letter-spacing: 0.05em;
  text-decoration: none;
  margin-bottom: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.kaya-global-nav .nav-brand small {
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: #19e8ff;
  margin-top: 1px;
}

.kaya-global-nav .nav-brand:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(25, 232, 255, 0.5);
  border-color: #19e8ff;
}

.kaya-global-nav .nav-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  align-items: center;
  flex: 1;
}

.kaya-global-nav-item {
  width: 68px;
  min-height: 54px;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: rgba(245, 247, 255, 0.65);
  border-radius: 14px;
  background: rgba(16, 26, 57, 0.45);
  border: 1px solid rgba(87, 121, 217, 0.16);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  box-sizing: border-box;
  cursor: pointer;
}

.kaya-global-nav-item svg {
  display: block;
  transition: transform 0.2s ease;
}

.kaya-global-nav-item .nav-label {
  opacity: 0.65;
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.kaya-global-nav-item:hover {
  background: rgba(25, 232, 255, 0.12);
  border-color: rgba(25, 232, 255, 0.4);
  color: #19e8ff;
  transform: translateY(-1px);
}

.kaya-global-nav-item:hover .nav-label {
  opacity: 1;
  color: #19e8ff;
}

.kaya-global-nav-item:active {
  transform: scale(0.94);
}

.kaya-global-nav-item.active {
  background: rgba(25, 232, 255, 0.16);
  border-color: #19e8ff;
  color: #19e8ff;
  box-shadow: 0 0 18px rgba(25, 232, 255, 0.3), inset 0 0 12px rgba(25, 232, 255, 0.15);
}

.kaya-global-nav-item.active .nav-label {
  opacity: 1;
  color: #ffffff;
  text-shadow: 0 0 8px #19e8ff;
}

/* PATRON GOD MODE DÜĞMESİ */
.kaya-global-nav-item.patron-god-btn {
  margin-top: auto;
  background: linear-gradient(145deg, rgba(40, 28, 5, 0.9), rgba(20, 14, 2, 0.95)) !important;
  border: 1.5px solid #ffb72f !important;
  color: #ffb72f !important;
  box-shadow: 0 0 22px rgba(255, 183, 47, 0.55), inset 0 0 12px rgba(255, 183, 47, 0.3) !important;
}

.kaya-global-nav-item.patron-god-btn svg {
  filter: drop-shadow(0 0 6px rgba(255, 183, 47, 0.85));
}

.kaya-global-nav-item.patron-god-btn .nav-label {
  color: #ffd768 !important;
  opacity: 0.95 !important;
  font-weight: 900 !important;
  letter-spacing: 0.06em !important;
  text-shadow: 0 0 8px rgba(255, 183, 47, 0.75);
}

.kaya-global-nav-item.patron-god-btn:hover {
  background: linear-gradient(145deg, rgba(65, 45, 8, 0.98), rgba(32, 22, 4, 1)) !important;
  box-shadow: 0 0 32px rgba(255, 183, 47, 0.8), inset 0 0 16px rgba(255, 183, 47, 0.45) !important;
  transform: scale(1.05);
}

/* ==========================================================================
   ADIM 2 & 3: HİBRİT NAVİGASYON (İNCE ALT MENÜ & KAYA ROBOT GİZLEME)
   ========================================================================== */
/* G75a: kırılma noktası 768→900 — ana sayfanın eski mobil çubuğu ≤900'de
   açılıyordu; tüm kabuklar aynı eşiği kullanır ki 769-900 aralığı menüsüz
   kalmasın (tek eşik = tutarlı görünüm). */
@media (max-width: 900px) {
  /* ADIM 1: Kaya Robot Mobil Alt Menüden Gizlenmesi */
  .hide-on-mobile,
  [data-nav-id="kaya-ai"] {
    display: none !important;
  }

  /* ADIM 3: Overlap Boşluğu (Gereksiz siyah boşluk bırakmayan 75px koruma) */
  body {
    padding-left: 0 !important;
    padding-bottom: 75px !important;
  }

  /* ADIM 2: Alt Menünün Zayıflatılması (60px Yükseklik & space-evenly) */
  .kaya-global-nav {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 60px !important;
    min-height: 60px !important;
    max-height: 60px !important;
    flex-direction: row !important;
    justify-content: space-evenly !important;
    align-items: center !important;
    padding: 5px 0 !important;
    border-right: none !important;
    border-top: 1px solid rgba(87, 121, 217, 0.28) !important;
    background: rgba(3, 8, 23, 0.94) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    box-shadow: 0 -4px 28px rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    z-index: 9999 !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
  }

  .kaya-global-nav .nav-brand {
    display: none !important;
  }

  /* G75b: TASMANIN KOKU — dugmelerin 4'u .nav-group ICINDE, PATRON DISINDA
     duruyor; ic kutunun genisligi (%100) + PATRON hep ekrandan tasiyordu.
     display:contents ic kutuyu yerlesimden cikarir: 5 dugme cubugun dogrudan
     cocugu gibi ESIT pay alir, hicbiri kesilmez. */
  .kaya-global-nav .nav-group { display: contents !important; }

  .kaya-global-nav-item {
    width: auto !important;
    min-width: 0 !important;
    flex: 1 1 0 !important;
    min-height: 48px !important;
    padding: 3px 2px !important;
    border-radius: 10px !important;
    margin: 0 2px !important;
  }

  .kaya-global-nav-item svg {
    width: 20px !important;
    height: 20px !important;
  }

  .kaya-global-nav-item .nav-label,
  .kaya-global-nav-item.patron-god-btn .nav-label {
    font-size: 8.5px !important;
    letter-spacing: 0.01em !important;
  }

  .kaya-global-nav-item.patron-god-btn {
    margin-top: 0 !important;
    margin-left: 2px !important;
    margin-right: 4px !important;
    flex: 1 1 0 !important;
    min-width: 0 !important;
    padding: 3px 4px !important;
  }

  /* G75b: cubuk tasmaz — tasan olursa kirpilir, yatay kaydirma cikmaz. */
  .kaya-global-nav { overflow-x: hidden !important; }
}

/* G75b (patron emri 21.08 "temalar ayni/uyumlu olsun"): evrensel menu olan
   sayfada SAYFAYA OZEL eski alt cubuklar (muhasebe/ofis/ozlem 'nav.bottom')
   gizlenir — muhasebe'de iki cubuk ust uste biniyordu (ekran goruntusuyle
   dogrulandi). Tek satirla geri alinabilir; sayfa JS'ine dokunulmadi. */
body:has(#kaya-global-nav) nav.bottom { display: none !important; }



/* G75a (patron emri 21.08): ana sayfa masaüstünde KENDİ sol rayını (.rail)
   kullanmaya devam eder — evrensel menü orada gizlenir ve gövde boşluğu
   açılmaz. Telefonda (≤768px) yukarıdaki mobil kurallar zaten çubuğu alta
   alır; 'yalniz-mobil' orada hiçbir şeyi değiştirmez. */
@media (min-width: 901px) {
  .kaya-global-nav.yalniz-mobil { display: none !important; }
  body:has(.kaya-global-nav.yalniz-mobil) { padding-left: 0 !important; }
}
