/**
 * KUBERA ASTRO - HEADER NAVIGATION & RESPONSIVE BURGER DRAWER
 * Strictly under 300 lines compliant (Rule 6).
 */

/* Desktop & General Header Setup */
.btn-burger-menu {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glow);
  color: var(--accent-gold-bright);
  font-size: 1.35rem;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-burger-menu:hover { background: rgba(245, 158, 11, 0.15); transform: scale(1.04); }
.btn-desktop-version {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(245, 158, 11, 0.1); border: 1px solid var(--border-glow);
  color: var(--accent-gold-bright); border-radius: var(--radius-pill);
  padding: 0.25rem 0.65rem; font-size: 0.72rem; font-weight: 800;
  cursor: pointer; transition: var(--transition-smooth);
}
.btn-desktop-version:hover {
  background: rgba(245, 158, 11, 0.2); transform: scale(1.03); color: #fff;
}

/* Mobile Drawer Overlay */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 15, 0.75);
  backdrop-filter: blur(10px);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-drawer.is-open {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* Mobile Drawer Content */
.mobile-drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 82%;
  max-width: 320px;
  height: 100%;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-glow);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1.15rem;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav-drawer.is-open .mobile-drawer-content {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.85rem;
  margin-bottom: 1.2rem;
}

.drawer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.drawer-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.drawer-title {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-white);
}

.drawer-title span {
  color: var(--accent-gold-bright);
}

.btn-drawer-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-white);
  font-size: 1.2rem;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  flex-grow: 1;
}

.drawer-item-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.drawer-item-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.05em;
}

.drawer-lang-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-pill);
  padding: 3px;
}

.drawer-lang-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 800;
  font-size: 0.82rem;
  padding: 0.45rem 0.5rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.drawer-lang-toggle button.is-active {
  background: var(--accent-gold);
  color: #070a14;
}

.drawer-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 800;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.drawer-btn-theme {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-glow);
  color: var(--text-primary);
}

.drawer-btn-pwa {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid var(--border-cyan);
  color: var(--accent-cyan);
}

.drawer-btn-patronage {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #070a14;
  border: none;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.drawer-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.85rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

/* Light Mode Overrides for Drawer */
[data-theme="light"] .btn-burger-menu { background: #ffffff; border-color: rgba(217, 119, 6, 0.3); color: #b45309; }

[data-theme="light"] .mobile-drawer-content { background: #ffffff; border-left-color: rgba(217, 119, 6, 0.35); box-shadow: -10px 0 35px rgba(15, 23, 42, 0.15); }

[data-theme="light"] .drawer-title {
  color: #0f172a;
}

[data-theme="light"] .btn-drawer-close { background: #f1f5f9; border-color: #cbd5e1; color: #0f172a; }

[data-theme="light"] .drawer-btn-theme { background: #f8fafc; color: #0f172a; border-color: rgba(217, 119, 6, 0.3); }

/* Mobile Media Query Switch */
@media (max-width: 820px) {
  .header-actions {
    display: none !important;
  }
  .btn-burger-menu {
    display: inline-flex !important;
  }
  .brand-title {
    font-size: 1.25rem !important;
    font-weight: 900 !important;
    letter-spacing: -0.01em !important;
  }
  .brand-tagline {
    display: block !important;
    font-size: 0.65rem !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    letter-spacing: 0.05em !important;
  }
  .brand-emblem {
    width: 38px !important;
    height: 38px !important;
  }
}

/* PWA Version Update Notification Banner */
.pwa-update-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid var(--accent-gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 15px rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10000;
  animation: slideUpBanner 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUpBanner {
  from { transform: translate(-50%, 40px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}
.pwa-update-text {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}
.btn-update-now {
  background: var(--accent-gold);
  color: #070a14;
  border: none;
  border-radius: var(--radius-pill);
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-update-now:hover {
  background: var(--accent-gold-bright);
  transform: scale(1.05);
}
