/* ============================
   nav.css — Shared Navigation Styles
   All pages load this file for consistent nav appearance
   Uses hardcoded values to avoid CSS variable conflicts
   ============================ */

/* ── Nav Container ── */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 12px 0;
  background: rgba(15, 14, 19, .85);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  transition: background .35s cubic-bezier(.22,1,.36,1), padding .35s cubic-bezier(.22,1,.36,1);
}
.main-nav.scrolled {
  background: rgba(15, 14, 19, .92);
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}

/* ── Nav Inner ── */
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Logo ── */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  font-weight: 700;
  font-size: 1.375rem;
  text-decoration: none;
  color: #eee9e0;
}
.logo-icon {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 8px rgba(244,166,35,.4));
}

/* ── Nav Links ── */
.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}
.nav-links a {
  font-size: .875rem;
  font-weight: 500;
  color: #9b95a0;
  text-decoration: none;
  transition: color .2s;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(135deg, #f4a623, #e67e22);
  border-radius: 2px;
  transition: width .35s cubic-bezier(.22,1,.36,1);
}
.nav-links a:hover { color: #f4a623; }
.nav-links a:hover::after { width: 100%; }
.nav-links a.nav-active { color: #f4a623; font-weight: 700; }

/* ── Dropdown ── */
.nav-links li { position: relative; }
.nav-dropdown-toggle { cursor: pointer; }
.nav-dropdown-toggle::after { content: ' ▾'; font-size: 0.7em; opacity: 0.6; }
.nav-dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  min-width: 200px;
  background: #2c2a33;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s, visibility .2s, transform .2s;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,.4);
}
.nav-links li.dropdown-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown a {
  display: block;
  padding: 8px 16px;
  font-size: .875rem;
  color: #9b95a0;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.nav-dropdown a::after { display: none !important; }
.nav-dropdown a:hover {
  background: rgba(244,166,35,.1);
  color: #f4a623;
}

/* ── Dropdown Section Header ── */
.nav-dd-section {
  padding: 6px 16px 2px;
  font-size: .7rem;
  font-weight: 700;
  color: #6a6470;
  text-transform: uppercase;
  letter-spacing: .5px;
  pointer-events: none;
}
.nav-dd-section:not(:first-child) {
  margin-top: 4px;
  border-top: 1px solid rgba(255,255,255,.06);
  padding-top: 8px;
}

/* ── CTA Nav Link (配對測驗) ── */
.nav-cta {
  background: linear-gradient(135deg, #f4a623, #e67e22) !important;
  color: #0f0e13 !important;
  padding: 6px 16px !important;
  border-radius: 50px !important;
  font-weight: 700 !important;
  font-size: .82rem !important;
  transition: transform .2s, box-shadow .2s !important;
  white-space: nowrap;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover {
  color: #0f0e13 !important;
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(244,166,35,.3);
}

/* ── Theme Toggle ── */
.theme-toggle {
  background: none;
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 9999px;
  width: 36px;
  height: 36px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
  flex-shrink: 0;
  color: inherit;
}
.theme-toggle:hover {
  background: rgba(244,166,35,.12);
  border-color: #f4a623;
}

/* ── Nav Burger (Mobile) ── */
.nav-burger {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: #eee9e0;
  padding: 4px;
}

/* ── Guide Nav Title (breed pages) ── */
.guide-nav-title {
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  font-weight: 500;
  font-size: .875rem;
  color: #6a6470;
  opacity: 0;
  transition: opacity .3s;
  white-space: nowrap;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,.06);
}
.main-nav.scrolled .guide-nav-title { opacity: 1; }

/* ── Light Mode Overrides ── */
[data-theme="light"] .main-nav {
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.06);
}
[data-theme="light"] .main-nav.scrolled {
  background: rgba(255,255,255,.92);
}
[data-theme="light"] .nav-logo { color: #1a1a1a; }
[data-theme="light"] .nav-links a { color: #555; }
[data-theme="light"] .nav-links a:hover { color: #d48806; }
[data-theme="light"] .nav-links a.nav-active { color: #d48806; }
[data-theme="light"] .nav-dropdown {
  background: #fff;
  border: 1px solid rgba(0,0,0,.08);
  box-shadow: 0 8px 32px rgba(0,0,0,.1);
}
[data-theme="light"] .nav-dropdown a { color: #555; }
[data-theme="light"] .nav-dropdown a:hover {
  background: rgba(212,136,6,.08);
  color: #d48806;
}
[data-theme="light"] .nav-dd-section {
  color: #999;
  border-top-color: rgba(0,0,0,.06);
}
[data-theme="light"] .theme-toggle {
  border-color: rgba(0,0,0,.08);
}
[data-theme="light"] .nav-burger { color: #1a1a1a; }
[data-theme="light"] .nav-cta {
  box-shadow: 0 2px 8px rgba(212,136,6,.2);
}

/* ── Mobile Responsive ── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-burger { display: block; }
  .nav-links.mobile-open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1820;
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding: 12px;
    gap: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,.3);
  }
  .nav-links.mobile-open .nav-dropdown {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    min-width: auto;
    padding: 0 12px;
    background: transparent;
  }
  .nav-links.mobile-open .nav-cta {
    display: inline-block;
    text-align: center;
    margin-top: 4px;
  }
  [data-theme="light"] .nav-links.mobile-open {
    background: #fff;
    border-bottom: 1px solid rgba(0,0,0,.06);
    box-shadow: 0 8px 32px rgba(0,0,0,.1);
  }
  [data-theme="light"] .nav-links.mobile-open .nav-dropdown {
    background: transparent;
  }
  .guide-nav-title { display: none; }
}
