/* ============================================
   GLOBAL NAVIGATION - Hamburger Menu
   ============================================ */

/* Adjust skip-link to not conflict with hamburger */
.skip-link:focus {
  top: 6px !important;
  left: 90px !important; /* Move right of hamburger button */
}

/* Hamburger Button */
.nav-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  width: 50px;
  height: 50px;
  background: var(--color-bg-secondary, rgba(255, 255, 255, 0.1));
  border: 2px solid var(--color-border, rgba(255, 255, 255, 0.2));
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.nav-toggle:hover {
  background: var(--color-bg-hover, rgba(255, 255, 255, 0.15));
  transform: scale(1.05);
}

.nav-toggle:focus {
  outline: 2px solid var(--color-primary-blue, #00aaff);
  outline-offset: 2px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-primary, #ffffff);
  transition: all 0.3s ease;
}

/* Hamburger animation when menu is open */
.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Navigation Drawer */
.nav-drawer {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100vh;
  background: var(--color-bg-primary, #0a0a0a);
  border-right: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
  z-index: 999;
  transition: left 0.3s ease;
  overflow-y: auto;
  padding: 80px 20px 20px;
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.5);
}

.nav-drawer.open {
  left: 0;
}

/* Overlay when menu is open */
.nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Navigation Links */
.nav-drawer nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-drawer a,
.nav-drawer button {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  color: var(--color-text-primary, #ffffff);
  text-decoration: none;
  border-radius: var(--radius-md, 8px);
  transition: all 0.2s ease;
  font-size: 16px;
  font-weight: 500;
  background: transparent;
  border: none;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.nav-drawer a:hover,
.nav-drawer button:hover {
  background: var(--color-bg-hover, rgba(255, 255, 255, 0.05));
  color: var(--color-primary-blue, #00aaff);
  transform: translateX(4px);
}

.nav-drawer a.active {
  background: var(--color-bg-active, rgba(0, 170, 255, 0.1));
  color: var(--color-primary-blue, #00aaff);
  border-left: 3px solid var(--color-primary-blue, #00aaff);
}

/* Section Headers */
.nav-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  color: var(--color-text-secondary, #aaaaaa);
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 16px;
}

.nav-section-header:first-child {
  margin-top: 0;
}

/* Collapsible Sections */
.nav-collapsible {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-collapsible-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-collapsible-trigger .arrow {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.nav-collapsible-trigger.expanded .arrow {
  transform: rotate(90deg);
}

.nav-collapsible-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 16px;
}

.nav-collapsible-content.expanded {
  max-height: 1000px;
}

.nav-collapsible-content a {
  font-size: 14px;
  padding: 8px 12px;
  color: var(--color-text-secondary, #cccccc);
}

.nav-collapsible-content a:hover {
  color: var(--color-primary-blue, #00aaff);
}

/* Icons in navigation - SVG icons */
.nav-icon {
  display: inline-block;
  vertical-align: middle;
  margin-right: 12px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Scrollbar styling for drawer */
.nav-drawer::-webkit-scrollbar {
  width: 6px;
}

.nav-drawer::-webkit-scrollbar-track {
  background: transparent;
}

.nav-drawer::-webkit-scrollbar-thumb {
  background: var(--color-border, rgba(255, 255, 255, 0.2));
  border-radius: 3px;
}

.nav-drawer::-webkit-scrollbar-thumb:hover {
  background: var(--color-border, rgba(255, 255, 255, 0.3));
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .nav-drawer {
    width: 280px;
    left: -300px;
  }

  .nav-toggle {
    top: 10px;
    left: 10px;
    width: 45px;
    height: 45px;
  }
}

/* Dark mode specific (already using CSS variables, but can add overrides) */
:root[data-theme="dark"] .nav-toggle {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

:root[data-theme="light"] .nav-toggle {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .nav-toggle span {
  background: #000000;
}

:root[data-theme="light"] .nav-drawer {
  background: #ffffff;
  border-right-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .nav-drawer a,
:root[data-theme="light"] .nav-drawer button {
  color: #000000;
}

:root[data-theme="light"] .nav-section-header {
  color: #666666;
}
