/* ============================================
   FILE: navbar.css
   PURPOSE: Fixed top navigation — glassmorphism, active states, mobile
   ============================================ */

#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999;
  
 transition: all 0.3s ease;
  justify-content: space-between;
  align-items: center;
  padding: 14px 40px;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);

  border-bottom: 1px solid var(--border-color);
}

/* Glass backing */
#navbar::before {
  content: '';
  position: absolute;
  inset: 0;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(2, 12, 10, 0.65);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
  z-index: -1;
}

/* Scrolled state */
#navbar.scrolled::before {
  background: rgba(2, 12, 10, 0.9);
  border-bottom-color: var(--border-hover);
  box-shadow: 0 4px 30px rgba(0,0,0,0.4), 0 1px 0 var(--accent-dim);
}

/* ── Container ── */
.nav-container {
  max-width: var(--container-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
}

/* ── Logo ── */
.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-primary);
  text-shadow: var(--glow);
  min-width: 120px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo span {
  color: var(--text-main);
}

/* ── Nav Links ── */
.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
  align-items: center;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 4px;
 /* border: 1px solid transparent; */
  position: relative;
  transition: all 0.3s ease;
  text-transform: uppercase;
}

.nav-link::before {
  content: attr(data-section);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.nav-link:hover {
  color: var(--accent-primary);
  text-shadow: var(--glow);
  background: transparent; /* remove dull bg */
  border-color: transparent;
}

/* Active link */
.nav-link.active {
  color: var(--accent-primary);
  background: transparent;
  border: none;
  box-shadow: none;
}
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;

  width: 100%;
  height: 2px;

  background: var(--accent-primary);
box-shadow: var(--glow);
}
.nav-link.active::before { opacity: 1; }

/* ── Hamburger ── */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  gap: 5px;
  padding: 10px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.hamburger:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--glow);
}

.hamburger .bar {
  width: 22px;
  height: 2px;
  background: var(--accent-primary);
  border-radius: 2px;
  transition: var(--transition);
}

/* Hamburger open state */
.hamburger.open .bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open .bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger.open .bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Menu ── */
.nav-links.open {
  display: flex;
  flex-direction: column;

  position: fixed;

  top: 78px;
  right: 14px;

  width: 240px;
  max-width: calc(100vw - 28px);

  background: rgba(2, 12, 10, 0.92);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  padding: 18px 16px;

  border-radius: 18px;

  align-items: stretch;
  gap: 10px;

border: 1px solid color-mix(in srgb, var(--accent-primary) 15%, transparent);
  box-shadow:
    0 10px 35px rgba(0,0,0,0.45),
0 0 20px color-mix(in srgb, var(--accent-primary) 8%, transparent);
  animation: mobileMenuSlide 0.25s ease;

  z-index: 9999;
}

.nav-links.open .nav-link {
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;

  padding: 12px 14px;

  border-radius: 12px;

  background: transparent;

  transition: all 0.25s ease;
}
@keyframes mobileMenuSlide{

  from{
    opacity: 0;
    transform: translateX(20px) scale(0.96);
  }

  to{
    opacity: 1;
    transform: translateX(0px) scale(1);
  }

}

.nav-links.open::before{
  content: '';

  position: absolute;
  inset: 0;

  border-radius: 18px;

  background:
  linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent-primary) 5%, transparent),
    transparent 40%
  );

  pointer-events: none;
}

/* ============================================
   THEME SWITCHER STYLES
   ADD THIS TO THE END OF navbar.css
   ============================================ */

/* ── Theme Switcher Container ── */
.theme-switcher-container {
  position: relative;
}

.theme-switcher {
  position: relative;
  display: flex;
  align-items: center;
}

/* ── Theme Toggle Button ── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--accent-primary);
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.theme-toggle::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, var(--accent-dim), transparent 90%);
  opacity: 0;
  transition: opacity 0.3s;
}

.theme-toggle:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--glow);
  transform: scale(1.05);
}

.theme-toggle:hover::before {
  opacity: 0.15;
}

.theme-toggle:active {
  transform: scale(0.95);
}

/* ── Theme Dropdown ── */
.theme-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: var(--bg-card-solid);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow-deep), var(--glow);
}

.theme-dropdown::before {
  content: '';
  position: absolute;
  top: -6px;
  right: 14px;
  width: 12px;
  height: 12px;
  background: var(--bg-card-solid);
  border-left: 1px solid var(--border-color);
  border-top: 1px solid var(--border-color);
  transform: rotate(45deg);
}

.theme-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ── Theme Options ── */
.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.theme-option::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-primary), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.theme-option:hover {
  border-color: var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-main);
  transform: translateX(2px);
}

.theme-option:hover::before {
  opacity: 0.05;
}

.theme-option.active {
  border-color: var(--accent-primary);
  background: var(--bg-elevated);
  color: var(--accent-primary);
}

.theme-option.active::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 12px;
  font-size: 0.7rem;
  color: var(--accent-primary);
}

/* ── Theme Color Preview ── */
.theme-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
  box-shadow: 0 0 8px currentColor;
  position: relative;
  z-index: 1;
}

.theme-label {
  flex: 1;
  text-align: left;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════════════════════
   MOBILE RESPONSIVE
══════════════════════════════════════════════ */

@media (max-width: 768px) {
  
  /* Theme switcher in mobile menu */
  .nav-links.open .theme-switcher-container {
    width: 100%;
    padding: 8px 0;
    border-top: 1px solid var(--border-color);
    margin-top: 8px;
  }
.nav-links.open .theme-toggle {
  width: 100%;

  display: flex;
  align-items: center;
  justify-content: center;

  gap: 8px;

  padding: 12px 14px;

  background: transparent;

  border: none;

  border-radius: 12px;

  color: var(--text-muted);

  font-family: var(--font-mono);

  font-size: 0.85rem;

  letter-spacing: 0.12em;

  text-transform: uppercase;

  box-shadow: none;

  transition: all 0.25s ease;
}

.nav-links.open .theme-toggle::after {
  content: 'Theme';

  font-family: var(--font-mono);

  font-size: 0.82rem;

  letter-spacing: 0.08em;

  text-transform: uppercase;

  color: var(--text-muted);
}
.nav-links.open .theme-toggle:hover{
  color: var(--accent-primary);

border-color: color-mix(in srgb, var(--accent-primary) 12%, transparent);
background: color-mix(in srgb, var(--accent-primary) 3%, transparent);
}
.nav-links.open .theme-dropdown {
  position: static;

  width: 100%;

  margin-top: 8px;

  opacity: 0;

  visibility: hidden;

  max-height: 0;

  overflow: hidden;

  background: rgba(2,12,10,0.96);

border: 1px solid color-mix(in srgb, var(--accent-primary) 12%, transparent);
  border-radius: 14px;

  padding: 0 8px;

  backdrop-filter: blur(18px);

  box-shadow:
    0 10px 30px rgba(0,0,0,0.45),
0 0 18px color-mix(in srgb, var(--accent-primary) 8%, transparent);
  transition: all 0.25s ease;
}

  .nav-links.open .theme-dropdown::before {
    display: none;
  }

.nav-links.open .theme-dropdown.active {
  opacity: 1;

  visibility: visible;

  max-height: 300px;

  padding: 8px;
}

 

.nav-links.open .theme-switcher-container{
  width: 100%;
}
.nav-links.open .theme-switcher,
.nav-links.open .theme-switcher-container{
  width: 100%;
}
}

/* ══════════════════════════════════════════════
   THEME-SPECIFIC ADJUSTMENTS
══════════════════════════════════════════════ */

/* Ensure theme toggle icon color matches theme */
[data-theme="purple"] .theme-toggle {
  color: #a78bfa;
}

[data-theme="blue"] .theme-toggle {
  color: #00d9ff;
}

/* Smooth color transitions */
.theme-toggle,
.theme-dropdown,
.theme-option,
.theme-color {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
/* ===== NAVBAR BRAND ===== */

.nav-logo{
  display: flex;
  align-items: center;
}

.nav-brand{
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-brand-icon{
  position: relative;

  width: 48px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;

  color: #ffffff;

  font-size: 1.25rem;
  font-weight: 700;
  font-family: 'Orbitron', sans-serif;

  background:
  radial-gradient(circle at top left,
    rgba(255,255,255,0.12),
    transparent 45%
  ),
  linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent-primary) 22%, transparent),
    color-mix(in srgb, var(--accent-primary) 10%, transparent)
  );

border: 1px solid color-mix(in srgb, var(--accent-primary) 40%, transparent);
  box-shadow:
  0 0 12px color-mix(in srgb, var(--accent-primary) 45%, transparent),
  0 0 28px color-mix(in srgb, var(--accent-primary) 20%, transparent),
  inset 0 0 12px rgba(255,255,255,0.08);

  overflow: hidden;

  animation:
  logoPulse 3s ease-in-out infinite,
  textGlitch 1.5s infinite;
  text-shadow:
  -2px 0 rgba(255,0,80,0.7),
  2px 0 rgba(0,255,255,0.7);
  transition: all 0.3s ease;
}

.nav-brand:hover .nav-brand-icon{
  transform: scale(1.06);
  border-color: var(--accent-primary);
}
.nav-brand-icon::before{
  content: '';

  position: absolute;
  inset: -20%;

  border-radius: 50%;

  background:
    repeating-linear-gradient(
      to bottom,
      rgba(255,255,255,0.12) 0px,
      rgba(255,255,255,0.12) 1px,
      transparent 2px,
      transparent 4px
    );

  opacity: 0.4;

  mix-blend-mode: screen;

  animation:
    glitchScan 3s linear infinite,
    glitchShift 1.2s infinite;  
  pointer-events: none;
}

.nav-brand-icon::after{
  content: '';

  position: absolute;
  filter: blur(0.5px);
  inset: -4px;

  border-radius: 50%;

border: 1px solid color-mix(in srgb, var(--accent-primary) 30%, transparent);
  animation: ringRotate 8s linear infinite;
}
.nav-brand-text{
  color: var(--text-main);

  font-size: 1rem;
  font-weight: 700;

  letter-spacing: 0.12em;

  font-family: 'Orbitron', sans-serif;

  text-transform: uppercase;
}

/* Navbar height fix */
.nav-container{
  height: 64px;
}

/* Mobile */
@media (max-width: 768px){

  .nav-container{
    height: 58px;
    padding: 10px 16px;
  }

  .nav-brand{
    gap: 10px;
  }

  .nav-brand-icon{
  width: 42px;
  height: 42px;
  font-size: 1.05rem;
}

  .nav-brand-text{
    font-size: 0.82rem;
    letter-spacing: 0.08em;
  }

}
@keyframes logoPulse{
  0%,100%{
    box-shadow:
      0 0 12px color-mix(in srgb, var(--accent-primary) 45%, transparent),
      0 0 28px color-mix(in srgb, var(--accent-primary) 18%, transparent),
      inset 0 0 12px rgba(255,255,255,0.08);
  }

  50%{
    box-shadow:
      0 0 18px color-mix(in srgb, var(--accent-primary) 70%, transparent),
      0 0 42px color-mix(in srgb, var(--accent-primary) 28%, transparent),
      inset 0 0 16px rgba(255,255,255,0.12);
  }
}



@keyframes glitchScan{
  0%{
    transform: translateY(-100%);
  }

  100%{
    transform: translateY(100%);
  }
}

@keyframes ringRotate{
  from{
    transform: rotate(0deg);
  }

  to{
    transform: rotate(360deg);
  }
}

@keyframes glitchShift{

  0%{
    transform: translate(0px,0px);
  }

  20%{
    transform: translate(-1px,1px);
  }

  40%{
    transform: translate(1px,-1px);
  }

  60%{
    transform: translate(-1px,0px);
  }

  80%{
    transform: translate(1px,1px);
  }

  100%{
    transform: translate(0px,0px);
  }

}

@keyframes textGlitch{

  0%{
    text-shadow:
      -2px 0 rgba(255,0,80,0.7),
      2px 0 rgba(0,255,255,0.7);

    transform: translate(0px);
  }

  20%{
    text-shadow:
      2px 0 rgba(255,0,80,0.9),
      -2px 0 rgba(0,255,255,0.9);

    transform: translate(0px);  }

  40%{
    text-shadow:
      -3px 0 rgba(255,0,80,0.8),
      3px 0 rgba(0,255,255,0.8);

    transform: translate(0px);
  }

  60%{
    text-shadow:
      3px 0 rgba(255,0,80,0.7),
      -3px 0 rgba(0,255,255,0.7);

    transform: translate(0px);  }

  80%{
    text-shadow:
      -2px 0 rgba(255,0,80,0.9),
      2px 0 rgba(0,255,255,0.9);

    transform: translate(0px);
  }

  100%{
    text-shadow:
      -2px 0 rgba(255,0,80,0.7),
      2px 0 rgba(0,255,255,0.7);

    transform: translate(0px);
  }

}