/* ==========================================================================
   GLOBAL NAVBAR & MOBILE DRAWER STYLES
   ========================================================================== */

.global-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 72px;
  background: rgba(8, 12, 22, 0.88);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 9999;
  display: flex;
  align-items: center;
  transition: background var(--transition-fast), border-color var(--transition-fast);
  padding: 0;
}

[data-theme="light"] .global-navbar {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.global-navbar .navbar-inner {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  width: 100% !important;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 1.25rem;
  box-sizing: border-box;
}

/* Brand Area */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  min-width: 0;
  flex-shrink: 1;
}

.brand-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  overflow: hidden;
  flex-shrink: 0;
}

.navbar-brand:hover .brand-icon-wrapper {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}

.brand-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.brand-text-block {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.brand-title {
  font-size: 1.15rem;
  line-height: 1.1;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-subtitle {
  font-size: 0.68rem;
  font-family: var(--font-body);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Navbar Navigation Links */
.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .navbar-links {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

.nav-link {
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] .nav-link:hover {
  background: rgba(0, 0, 0, 0.06);
}

.nav-link.active {
  color: #ffffff;
  background: var(--color-primary-gradient);
  box-shadow: 0 4px 14px var(--color-primary-glow);
}

/* Right Actions Container */
.navbar-actions {
  display: flex !important;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0 !important;
  flex-wrap: nowrap;
  margin-left: auto;
}

/* Theme Toggle Button */
.btn-theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0 !important;
}

.btn-theme-toggle:hover {
  border-color: var(--border-medium);
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(15deg);
}

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

/* Mobile Hamburger Toggle */
.btn-mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  border: 1.5px solid rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.15);
  color: #ffffff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0 !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.25);
}

.btn-mobile-toggle:hover,
.btn-mobile-toggle:active {
  background: var(--color-primary);
  border-color: #60a5fa;
  transform: scale(1.05);
  box-shadow: 0 0 18px var(--color-primary-glow);
}

[data-theme="light"] .btn-mobile-toggle {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.12);
}

[data-theme="light"] .btn-mobile-toggle:hover,
[data-theme="light"] .btn-mobile-toggle:active {
  background: #2563eb;
  border-color: #1d4ed8;
  color: #ffffff;
}

/* Mobile Navigation Drawer */
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 76px;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 2px solid var(--border-medium);
  padding: 1.25rem 1rem 1.75rem;
  flex-direction: column;
  gap: 0.65rem;
  z-index: 9998;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  animation: slideDown 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  max-height: calc(100vh - 76px);
  overflow-y: auto;
}

[data-theme="light"] .mobile-nav-drawer {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 2px solid rgba(203, 213, 225, 0.8);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.mobile-nav-drawer.open {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-nav-link {
  padding: 0.95rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1.5px solid transparent;
  min-height: 50px;
  background: rgba(255, 255, 255, 0.03);
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

[data-theme="light"] .mobile-nav-link {
  background: #f8fafc;
  color: #334155;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--color-primary);
  transform: translateX(4px);
}

.mobile-nav-link.active {
  background: var(--color-primary-gradient);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 18px var(--color-primary-glow);
}

/* Responsive Navigation Breakpoint */
@media (max-width: 900px) {
  .navbar-links {
    display: none !important;
  }
  .btn-mobile-toggle {
    display: flex !important;
  }
  .navbar-cta-desktop {
    display: none !important;
  }
}

/* ---- Tablet / Large Phone (≤ 640px) ---- */
@media (max-width: 640px) {
  .global-navbar {
    height: 58px;
  }
  .global-navbar .navbar-inner {
    padding: 0 0.75rem;
  }
  .page-wrapper {
    padding-top: 80px !important;
  }
  .navbar-brand {
    gap: 0.45rem;
  }
  .brand-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    padding: 1px;
  }
  .brand-title {
    font-size: 0.95rem;
  }
  .brand-subtitle {
    font-size: 0.55rem;
    letter-spacing: 0.06em;
  }
  .navbar-actions {
    gap: 0.4rem;
    flex-shrink: 0;
  }
  .btn-theme-toggle {
    width: 36px;
    height: 36px;
  }
  .btn-theme-toggle svg {
    width: 17px;
    height: 17px;
  }
  .btn-mobile-toggle {
    width: 36px;
    height: 36px;
  }
  .btn-mobile-toggle svg {
    width: 19px;
    height: 19px;
  }
  .mobile-nav-drawer {
    top: 58px;
    max-height: calc(100vh - 58px);
    padding: 1rem 0.75rem 1.5rem;
  }
}

/* ---- Medium Phone (≤ 480px) ---- */
@media (max-width: 480px) {
  .global-navbar {
    height: 56px;
  }
  .global-navbar .navbar-inner {
    padding: 0 0.65rem;
  }
  .page-wrapper {
    padding-top: 76px !important;
  }
  .navbar-brand {
    gap: 0.45rem;
    flex-shrink: 0;
  }
  .brand-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }
  .brand-title {
    font-size: 0.95rem;
    font-weight: 800;
  }
  .brand-subtitle {
    display: none !important;
  }
  .navbar-actions {
    gap: 0.45rem;
    flex-shrink: 0 !important;
    margin-left: auto;
  }
  .btn-theme-toggle {
    width: 36px;
    height: 36px;
  }
  .btn-theme-toggle svg {
    width: 17px;
    height: 17px;
  }
  .btn-mobile-toggle {
    width: 38px;
    height: 38px;
    display: flex !important;
  }
  .btn-mobile-toggle svg {
    width: 19px;
    height: 19px;
  }
  .mobile-nav-drawer {
    top: 56px;
    max-height: calc(100vh - 56px);
    padding: 0.85rem 0.65rem 1.25rem;
  }
  .mobile-nav-link {
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    min-height: 48px;
  }
}

/* ---- Small Phone (≤ 380px) ---- */
@media (max-width: 380px) {
  .global-navbar {
    height: 50px;
  }
  .global-navbar .navbar-inner {
    padding: 0 0.5rem;
  }
  .page-wrapper {
    padding-top: 70px !important;
  }
  .navbar-brand {
    gap: 0.35rem;
  }
  .brand-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
  }
  .brand-title {
    font-size: 0.82rem;
  }
  .brand-subtitle {
    display: none;
  }
  .navbar-actions {
    gap: 0.35rem;
    margin-left: auto;
    flex-shrink: 0 !important;
  }
  .btn-theme-toggle {
    width: 32px;
    height: 32px;
    border-width: 1px;
  }
  .btn-theme-toggle svg {
    width: 15px;
    height: 15px;
  }
  .btn-mobile-toggle {
    width: 32px;
    height: 32px;
    border-width: 1px;
  }
  .btn-mobile-toggle svg {
    width: 17px;
    height: 17px;
  }
  .mobile-nav-drawer {
    top: 50px;
    max-height: calc(100vh - 50px);
    padding: 0.75rem 0.5rem 1rem;
  }
  .mobile-nav-link {
    padding: 0.75rem 0.85rem;
    font-size: 0.88rem;
    min-height: 44px;
  }
}

/* ---- Very Small Phone (≤ 320px) ---- */
@media (max-width: 320px) {
  .global-navbar {
    height: 48px;
  }
  .page-wrapper {
    padding-top: 66px !important;
  }
  .brand-icon-wrapper {
    width: 28px;
    height: 28px;
    border-radius: 6px;
  }
  .brand-title {
    font-size: 0.75rem;
  }
  .btn-theme-toggle {
    width: 30px;
    height: 30px;
  }
  .btn-mobile-toggle {
    width: 30px;
    height: 30px;
  }
  .mobile-nav-drawer {
    top: 48px;
    max-height: calc(100vh - 48px);
  }
}



