/* --- RESET --- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, sans-serif;
  background: radial-gradient(circle at 50% 30%, #020a16 0%, #000 100%);
  color: #c9d1d9;
}

/* ==========================
   Navbar Mobile-First
========================= */
:root {
  --nav-bg: rgba(0, 0, 0, 0.65);
  --nav-text: #ffffff;
  --nav-accent: #22d8ff;
  --nav-radius: 12px;
  --nav-transition: 0.3s ease;
}

#navbar-root nav {
  display: flex;
  justify-content: center; /* center container horizontally */
  align-items: center;     /* center vertically */
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  backdrop-filter: blur(6px) saturate(1.05);
  border-radius: var(--nav-radius);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.nav-container {
  display: flex;
  align-items: center;      /* vertical center */
  justify-content: center;  /* horizontal center */
  gap: 24px;                /* spacing between logo and nav-links */
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
}

.logo img {
  width: 50px;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;     /* vertical center */
  justify-content: center; /* horizontal center */
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links li {
  display: flex;
  align-items: center;
  justify-content: center; /* ensures link content is centered */
}

.nav-links li a {
  display: flex;
  align-items: center;
  justify-content: center; /* center icon/text */
  text-decoration: none;
  color: var(--nav-text);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background var(--nav-transition), color var(--nav-transition);
}

/* Hover & Active */
.nav-links li a:hover,
.nav-links li a.active {
  background: var(--nav-accent);
  color: #000;
}

/* Icon sizing for nav buttons */
.nav-links li a img.nav-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* Slightly bigger main logo */
.nav-links li a img[src*="mainlogo"] {
  width: 50px;
  height: auto;
}

/* notification bell */
#notif-bell-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center; /* center the bell */
}

#notif-bell {
  width: 24px;
  cursor: pointer;
  display: block;
}

#notif-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: red;
  color: #fff;
  border-radius: 50%;
  font-size: 10px;
  padding: 2px 5px;
  display: flex;           /* centers number inside badge */
  align-items: center;
  justify-content: center;
}

.bell-unread {
  filter: drop-shadow(0 0 2px red);
}


/* hamburger toggle */
.nav-toggle {
  font-size: 1.6rem;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--nav-text);
  transition: color var(--nav-transition);
}

.nav-toggle.active {
  color: var(--nav-accent);
}

@media (max-width: 520px) {
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .nav-links li a {
    font-size: 0.88rem;
    padding: 6px 10px;
  }

  .nav-links li a img.nav-icon {
    width: 28px;
    height: 28px;
  }

  .nav-links li a img[src*="mainlogo"] {
    width: 40px;
  }
}

/* --- WRAPPER --- */
#brain-wrapper {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

/* --- CANVAS --- */
#brain-canvas {
  width: 100%;
  height: 100%;
  cursor: grab;
  background: radial-gradient(circle at 50% 50%, #030a18 0%, #000 100%);
  filter: drop-shadow(0 0 30px rgba(0,255,255,0.1));
}
#brain-canvas:active { cursor: grabbing; }

/* --- INFO PANEL --- */
#brain-info {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 20, 30, 0.7);
  padding: .5rem 1rem;
  border-radius: 12px;
  font-size: .8rem;
  letter-spacing: .5px;
  color: #a8cfff;
  backdrop-filter: blur(8px);
  box-shadow: 0 0 12px rgba(0,200,255,0.3);
}

/* --- LOADING SCREEN --- */
#loading-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.85);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 600;
  z-index: 10;
}

#loading-text {
  text-align: center;
  line-height: 1.6;
}

/* --- ORB / NEURON GLOW --- */
.orb {
  position: absolute;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: #c9e8ff;
  text-shadow: 0 0 5px rgba(180,240,255,0.8);
  font-weight: 600;
  animation: orbPulse 3s ease-in-out infinite;
  transition: transform 0.3s ease;
}

/* Brain Orb (F) */
.orb.F {
  background: radial-gradient(circle at 30% 30%, #00eaff 0%, #0070ff 90%);
  box-shadow:
    0 0 40px rgba(0,255,255,0.5),
    0 0 80px rgba(0,180,255,0.3);
  animation-delay: 0s;
}

/* Tag Orb (G) */
.orb.G {
  background: radial-gradient(circle at 30% 30%, #0080ff 0%, #0020ff 90%);
  box-shadow:
    0 0 30px rgba(0,160,255,0.4),
    0 0 60px rgba(0,80,255,0.2);
  animation-delay: .7s;
}

/* Topic Orb (H) */
.orb.H {
  background: radial-gradient(circle at 30% 30%, #ff00ff 0%, #7000ff 90%);
  box-shadow:
    0 0 25px rgba(255,0,255,0.4),
    0 0 50px rgba(180,0,255,0.2);
  animation-delay: 1.3s;
}

/* --- ELECTRIC SYNAPSES --- */
.synapse {
  position: absolute;
  pointer-events: none;
  background: linear-gradient(
    to right,
    rgba(0,255,255,0),
    rgba(0,255,255,.6),
    rgba(0,255,255,0)
  );
  height: 2px;
  transform-origin: left center;
  overflow: hidden;
}
.synapse::after {
  content: "";
  position: absolute;
  top: 0;
  left: -20%;
  width: 20%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #00ffff, transparent);
  animation: sparkTravel 1.5s linear infinite;
}

/* --- ANIMATIONS --- */
@keyframes orbPulse {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.05); filter: brightness(1.3); }
}

@keyframes sparkTravel {
  0% { left: -20%; }
  100% { left: 120%; }
}
