@font-face {
  font-family: 'MapleStory';
  src: url('../fonts/maplestory.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

/* === Sidebar Navigation Stack Container === */
.nav-sidebar-stack {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0; /* remove spacing */
  z-index: 1001;
}

/* === Sidebar Navigation Buttons === */
.nav-sidebar {
  position: relative; /* relative inside the stack */
  background-color: rgba(25, 25, 40, 0.8);
  color: #00ffff;
  padding: 0.6em 0.8em;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-size: 0.85em;
  font-weight: bold;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 10px #00ffff55;
  animation: glowPulse 2.5s infinite;
  font-family: 'MapleStory', 'Segoe UI', sans-serif;
  user-select: none;
  transition: box-shadow 0.25s ease, background-color 0.25s ease, color 0.25s ease;
}

/* === Sidebar Navigation Buttons Hover Effect === */
.nav-sidebar:hover {
  background-color: rgba(25, 25, 40, 0.9);
  box-shadow: 0 0 16px #00ffffaa;
  color: #fff;
  text-shadow: 0 0 6px #00ffff, 0 0 12px #00ffff;
}

@keyframes glowPulse {
  0%   { box-shadow: 0 0 10px #00ffff55; }
  50%  { box-shadow: 0 0 14px #00ffffaa; }
  100% { box-shadow: 0 0 10px #00ffff55; }
}

/* === Hide Map (left side) stays separate === */
#mapSidebar {
  position: fixed;
  top: 100px;
  left: 0;
  background-color: rgba(0,0,0,0.6);
  color: #fff;
  padding: 0.5em 1em;
  cursor: pointer;
  font-size: 0.9em;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  z-index: 1000;
  transition: background 0.3s ease;
}
#mapSidebar:hover {
  background-color: rgba(0,0,0,0.8);
}

/* === Backdrop === */
.nav-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 999;
  transition: opacity 0.3s ease;
  user-select: none;
}
.nav-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

/* === Drawer Panels (Navigation, Maps, BGM, etc.) === */
.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 240px;
  background: rgba(25, 25, 40, 0.95);
  box-shadow: -2px 0 12px #00ffff55;
  backdrop-filter: blur(10px);
  padding: 1em;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  font-family: 'MapleStory', 'Segoe UI', sans-serif;
  user-select: none;
  transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.3s ease;

  /* hidden by default */
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
}
.nav-drawer.open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}

/* === Drawer Title === */
.map-title {
  font-size: 0.9em;
  color: #00ffff;
  margin-bottom: 0.6em;
  text-align: center;
  font-weight: bold;
  text-shadow: 0 0 6px #00ffff88;
  font-family: 'MapleStory', 'Segoe UI', sans-serif;
  user-select: none;
}

/* === Map Buttons === */
.map-button {
  display: block;
  width: 100%;
  padding: 0.6em 0.8em;
  font-size: 0.9em;
  border: none;
  background-color: #1a1a1a;
  color: #00ffff;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.2s ease;
  font-family: 'MapleStory', 'Segoe UI', sans-serif;
  user-select: none;
}
.map-button:hover {
  background-color: #00ffff22;
}

/* === Active State (root + subregion) === */
.map-button.active,
.map-button.root.active,
.map-button.subregion.active {
  background-color: transparent;
  border-left: 4px solid #00ffff;
  color: #fff;
  box-shadow: 0 0 12px #00ffffaa;
  font-weight: bold;
  animation: activePulse 2s infinite;
  font-size: 0.9em;
  padding-left: 0.8em;
}

@keyframes activePulse {
  0%   { box-shadow: 0 0 8px #00ffff44; }
  50%  { box-shadow: 0 0 12px #00ffffaa; }
  100% { box-shadow: 0 0 8px #00ffff44; }
}

/* === Root and Subregion Buttons (default) === */
.map-button.root,
.map-button.subregion {
  font-size: 0.85em;
  color: #00ffffcc;
  background-color: #1a1a1a;
  border-left: none;
  padding-left: 0.6em;
}
.map-button.subregion:hover {
  background-color: #00ffff11;
}

/* === Subregion Grouping === */
.subregion-group {
  margin-left: 1.2em;
  border-left: 2px solid #00ffff33;
  padding-left: 0.6em;
  margin-top: 0.4em;
  user-select: none;
}

/* === Nav Search Bar === */
.nav-search {
  width: 100%;
  padding: 0.5em 0.8em;
  margin-bottom: 0.8em;
  border-radius: 6px;
  border: 1px solid #00ffff55;
  background-color: #111;
  color: #00ffff;
  font-family: 'MapleStory', 'Segoe UI', sans-serif;
  font-size: 0.85em;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.nav-search:focus {
  border-color: #00ffffaa;
  box-shadow: 0 0 6px #00ffff88;
}

/* === Scrollable Drawer Content === */
.nav-drawer {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #00ffff44 transparent;
}
.nav-drawer::-webkit-scrollbar {
  width: 6px;
}
.nav-drawer::-webkit-scrollbar-thumb {
  background-color: #00ffff55;
  border-radius: 4px;
}
.nav-drawer::-webkit-scrollbar-thumb:hover {
  background-color: #00ffffaa;
}
