/* ============================================================
   NAV.CSS
   ============================================================ */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 64px;
  background: var(--color-nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  transition: background 0.3s;
}

.nav__logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}

.nav__logo:hover {
  opacity: 0.8;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav__link {
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  font-family: var(--font-body);
}

.nav__link:hover,
.nav__link.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.nav__admin-badge {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-right: 8px;
}

/* ---- Theme Switcher (fixed bottom-right) ---- */
.theme-switcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.theme-switcher__label {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-family: var(--font-body);
}

.theme-switcher__btn {
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-family: var(--font-body);
}

.theme-switcher__btn:hover,
.theme-switcher__btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* ============================================================
   MOBILE NAV — drawer triggered by decorative icon
   ============================================================ */

/* Split the logo into icon (clickable toggle) + text on mobile */
.nav__logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav__logo-icon {
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  /* Subtle tap affordance on mobile */
  transition: transform 0.2s;
}

.nav__logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .nav {
    padding: 0 20px;
    height: 56px;
  }

  /* Hide all desktop links on mobile */
  .nav__links--desktop {
    display: none !important;
  }

  /* Make the butterfly pulse gently to hint it's tappable */
  .nav__logo-icon {
    animation: butterflyPulse 3s ease-in-out infinite;
  }

  @keyframes butterflyPulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50%       { transform: scale(1.15) rotate(-5deg); }
  }

  .nav__logo-text {
    font-size: 18px;
    /* Truncate if studio name is very long */
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 55vw;
  }
}

/* ---- Drawer overlay ---- */
.nav-drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1100;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.nav-drawer-overlay.open {
  display: block;
  opacity: 1;
}

/* ---- Drawer panel ---- */
.nav-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 82vw);
  background: var(--color-surface);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 4px 0 32px rgba(0, 0, 0, 0.18);
  border-right: 1px solid var(--color-border);
}
.nav-drawer.open {
  transform: translateX(0);
}

/* Only show drawer elements on mobile */
@media (min-width: 769px) {
  .nav-drawer,
  .nav-drawer-overlay {
    display: none !important;
  }
}

.nav-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 20px;
  border-bottom: 1px solid var(--color-border);
}

.nav-drawer__logo {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.02em;
}

.nav-drawer__close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--color-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}
.nav-drawer__close:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}

.nav-drawer__links {
  list-style: none;
  padding: 16px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  overflow-y: auto;
}

.nav-drawer__link {
  display: block;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  letter-spacing: 0.04em;
  transition: background 0.18s, color 0.18s;
  border-left: 3px solid transparent;
}
.nav-drawer__link:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
}
.nav-drawer__link.active {
  background: var(--color-bg-alt);
  color: var(--color-primary);
  border-left-color: var(--color-primary);
  font-weight: 700;
}

