/* ==========================================================================
   SAATDURUM — DİNAMİK ALT NAVİGASYON (DYNAMIC LIQUID GLASS BOTTOM NAVIGATION)
   - Apple Tarzı Ultra-Premium Kapsül (Floating Capsule)
   - Glassmorphism & Liquid Glass Estetiği
   - Sol Sabit Geri Butonu & İnce Cam Ayraç (Sticky Left Pill)
   - Yatay Kaydırılabilir Menü Öğeleri (Horizontal Scroll, No Scrollbar)
   - Yön Duyarlı Donanım Hızlandırmalı Geçiş Animasyonları
   - Tam Ekran & Klavye Gizlenme Kuralları
   ========================================================================== */

:root {
  --sd-dnav-bg: rgba(16, 18, 24, 0.84);
  --sd-dnav-border: rgba(255, 255, 255, 0.12);
  --sd-dnav-border-hover: rgba(255, 255, 255, 0.22);
  --sd-dnav-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --sd-dnav-text: rgba(255, 255, 255, 0.65);
  --sd-dnav-text-active: #FFFFFF;
  --sd-dnav-active-bg: rgba(255, 255, 255, 0.11);
  --sd-dnav-active-border: rgba(255, 255, 255, 0.18);
  --sd-dnav-active-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  --sd-dnav-height: 64px;
  --sd-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ── 0. ÜST MENÜLERİ GİZLEME (Masaüstü ve Mobilde Tek Menü: Alt Kapsül) ── */
.nav-dropdown,
#nav-dropdown,
.online-top-tabs-nav {
  display: none !important;
}

/* ── 1. ANA KAPSÜL (CONTAINER) ── */
.mobile-bottom-nav,
.sd-dynamic-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(12px + var(--sd-safe-bottom));
  width: calc(100% - 24px);
  max-width: 480px;
  height: var(--sd-dnav-height);
  min-height: var(--sd-dnav-height);
  box-sizing: border-box;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--sd-dnav-bg);
  border: 1px solid var(--sd-dnav-border);
  box-shadow: var(--sd-dnav-shadow);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  z-index: 240;
  user-select: none;
  -webkit-user-select: none;
  contain: layout style;
  transition: opacity 0.24s ease, transform 0.24s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.24s ease;
  overflow: hidden;
}

/* ── 2. SOL SABİT MİKRO GERİ DÖNÜŞ BUTONU (MINIMAL CIRCLE ICON) ── */
.sd-dnav-back-wrap {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  height: 100%;
  padding-left: 2px;
  margin-right: 0;
  opacity: 0;
  max-width: 0;
  pointer-events: none;
  overflow: hidden;
  transition: max-width 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, margin 0.22s ease;
}

.sd-dnav-back-wrap.is-visible {
  opacity: 1;
  max-width: 46px;
  pointer-events: auto;
  margin-right: 4px;
}

.sd-dnav-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  max-width: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: var(--sd-dnav-text-active);
  cursor: pointer;
  transition: background 0.16s ease, transform 0.15s ease, border-color 0.16s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.sd-dnav-back-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
}

.sd-dnav-back-btn:active {
  transform: scale(0.90);
  background: rgba(255, 255, 255, 0.22);
}

.sd-dnav-back-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent, #7AA7FF);
}

.sd-dnav-back-label {
  display: none !important;
}

/* Dikey İnce Cam Ayraç Çizgisi */
.sd-dnav-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.14);
  margin-left: 6px;
  flex-shrink: 0;
}

/* ── 3. KAYDIRILABİLİR MENÜ ÖĞELERİ ALANI (SCROLL CONTAINER) ── */
.sd-dnav-scroll-wrap {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / Edge */
}

.sd-dnav-scroll-wrap::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.sd-dnav-items-track {
  display: flex;
  align-items: center;
  justify-content: space-around;
  min-width: 100%;
  gap: 3px;
  padding: 0 2px;
  will-change: transform, opacity;
}

/* ── 4. MENÜ BUTONU (ITEM) ── */
.sd-dnav-item {
  flex: 1 0 auto;
  min-width: 52px;
  max-width: 84px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--sd-dnav-text);
  font-family: inherit;
  cursor: pointer;
  position: relative;
  transition: color 0.16s ease, transform 0.15s ease, background 0.18s ease, border-color 0.18s ease;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

.sd-dnav-item:hover:not(.active) {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.04);
}

.sd-dnav-item:active {
  transform: scale(0.92);
}

/* Aktif Buton (Liquid Glass Pill) */
.sd-dnav-item.active {
  color: var(--sd-dnav-text-active);
  background: var(--sd-dnav-active-bg);
  border-color: var(--sd-dnav-active-border);
  box-shadow: var(--sd-dnav-active-shadow);
}

.sd-dnav-item.active .sd-dnav-icon-wrap svg {
  transform: translateY(-1px) scale(1.08);
  color: var(--text-p, #F5F5F7);
}

.sd-dnav-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sd-dnav-icon-wrap svg {
  flex-shrink: 0;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.16s ease;
}

.sd-dnav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.1;
  transition: color 0.16s ease, font-weight 0.16s ease;
}

.sd-dnav-item.active .sd-dnav-label {
  color: #FFFFFF;
  font-weight: 700;
}

/* ── 5. CANLI SAYAÇ NOKTASI (PULSE LIVE DOT) ── */
.sd-dnav-live-dot {
  position: absolute;
  top: -2px;
  right: -5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.85);
  animation: sdDotPulse 1.8s infinite ease-in-out;
}

@keyframes sdDotPulse {
  0% { transform: scale(0.9); opacity: 0.75; box-shadow: 0 0 4px rgba(16, 185, 129, 0.6); }
  50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 10px rgba(16, 185, 129, 1); }
  100% { transform: scale(0.9); opacity: 0.75; box-shadow: 0 0 4px rgba(16, 185, 129, 0.6); }
}

/* ── 6. OKUNMAMIŞ MESAJ BİLDİRİM ROZETİ ── */
.sd-dnav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 9px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.4);
  line-height: 1;
}

/* ── 7. YÖN DUYARLI GEÇİŞ ANİMASYONLARI (DIRECTIONAL MOTION) ── */
.sd-motion-out-left {
  animation: sdMotionOutLeft 0.12s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.sd-motion-in-right {
  animation: sdMotionInRight 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.sd-motion-out-right {
  animation: sdMotionOutRight 0.12s cubic-bezier(0.4, 0, 1, 1) forwards;
}

.sd-motion-in-left {
  animation: sdMotionInLeft 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sdMotionOutLeft {
  0% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(-16px); }
}

@keyframes sdMotionInRight {
  0% { opacity: 0; transform: translateX(16px); }
  100% { opacity: 1; transform: translateX(0); }
}

@keyframes sdMotionOutRight {
  0% { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(16px); }
}

@keyframes sdMotionInLeft {
  0% { opacity: 0; transform: translateX(-16px); }
  100% { opacity: 1; transform: translateX(0); }
}

/* ── 8. GİZLENME DURUMLARI (TAM EKRAN, ODAK, SOHBET, KLAVYE) ── */
body.focus-mode .mobile-bottom-nav,
body.focus-mode-active .mobile-bottom-nav,
body.library-study-active .mobile-bottom-nav,
body.library-deep-focus-active .mobile-bottom-nav,
body.chat-fullscreen-open .mobile-bottom-nav,
body.keyboard-open .mobile-bottom-nav,
body.sd-fullscreen-active .mobile-bottom-nav,
body.focus-mode #mobile-bottom-nav,
body.focus-mode-active #mobile-bottom-nav,
body.library-study-active #mobile-bottom-nav,
body.library-deep-focus-active #mobile-bottom-nav,
body.chat-fullscreen-open #mobile-bottom-nav,
body.keyboard-open #mobile-bottom-nav,
body.sd-fullscreen-active #mobile-bottom-nav {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ── 9. RESPONSIVE VE MASAÜSTÜ UYUMU ── */
@media (min-width: 769px) {
  .mobile-bottom-nav,
  .sd-dynamic-nav {
    max-width: 520px;
    bottom: 24px;
    padding: 6px 10px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7), 0 4px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }

  .sd-dnav-item {
    min-width: 60px;
    max-width: 96px;
    height: 52px;
    cursor: pointer;
  }

  .sd-dnav-label {
    font-size: 11px;
    font-weight: 600;
  }
}

@media (max-width: 400px) {
  .mobile-bottom-nav,
  .sd-dynamic-nav {
    width: calc(100% - 16px);
    bottom: calc(8px + var(--sd-safe-bottom));
    height: 60px;
    min-height: 60px;
    padding: 4px 6px;
  }

  .sd-dnav-item {
    min-width: 48px;
    height: 48px;
    padding: 3px 4px;
  }

  .sd-dnav-label {
    font-size: 9px;
  }

  .sd-dnav-back-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    max-width: 32px;
  }
}
