/* Header and Navigation Styles */

/* Header */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

header nav {
  position: relative;
}

nav {
  background: var(--theme-bg-secondary, rgba(15, 15, 20, 1));
  padding: 8px 20px;
  color: var(--theme-text-primary, var(--text-color, #e0e0e0));
  box-shadow: 0 2px 10px var(--theme-card-shadow, rgba(0,0,0,0.3));
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--theme-accent-primary, var(--primary-color, #ffd700));
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  max-width: 100%;
  flex-wrap: wrap;
  position: relative;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
  min-width: fit-content;
  padding-right: 15px;
}

.hub-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  color: var(--theme-text-primary, var(--text-color, #e0e0e0));
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-family: var(--display-font, 'AnimeAce', sans-serif);
}

.hub-logo img {
  filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8))
          drop-shadow(0 0 15px rgba(255, 215, 0, 0.6))
          drop-shadow(0 0 25px rgba(255, 215, 0, 0.4));
  transition: filter 0.3s ease;
}

.hub-logo:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary-color, #ffd700);
}

.hub-logo:hover img {
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.9))
          drop-shadow(0 0 20px rgba(255, 215, 0, 0.7))
          drop-shadow(0 0 30px rgba(255, 215, 0, 0.5));
}

.hub-logo.active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.3));
  color: var(--primary-color, #ffd700);
  border-bottom: 2px solid var(--primary-color, #ffd700);
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 5px;
  align-items: center;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
  min-width: 0;
  max-width: 100%;
}

.nav-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 15px;
  min-width: fit-content;
}

.admin-dashboard-link {
  background: var(--primary-color, #8a2be2);
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9em;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.admin-dashboard-link:hover {
  background: var(--secondary-color, #9C27B0);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(138, 43, 226, 0.4);
}

.profile-link {
  color: var(--primary-color, #8a2be2);
  text-decoration: none;
  font-size: 0.9em;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  margin-right: 10px;
}

.profile-link:hover {
  color: var(--secondary-color, #9C27B0);
  text-decoration: underline;
}

/* Profile link as dropdown trigger */
.nav-right .has-dropdown .profile-link {
  color: var(--theme-text-primary, var(--text-color, #e0e0e0));
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin-right: 0;
  text-decoration: none;
}

.nav-right .has-dropdown .profile-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary-color, #ffd700);
  text-decoration: none;
}

.nav-right .has-dropdown .profile-link.active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.3));
  color: var(--primary-color, #ffd700);
  border-bottom: 2px solid var(--primary-color, #ffd700);
}

.logout-btn {
  background: transparent;
  border: 1px solid #ddd;
  color: #666;
  padding: 8px 16px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s ease;
  white-space: nowrap;
  margin-left: 5px;
}

.logout-btn:hover {
  background: #f5f5f5;
  border-color: #999;
  color: #333;
}

.login-link {
  color: var(--primary-color, #8a2be2);
  text-decoration: none;
  font-size: 0.9em;
  white-space: nowrap;
  transition: all 0.2s ease;
  padding: 8px 16px;
  border: 1px solid var(--primary-color, #8a2be2);
  border-radius: 5px;
  margin-left: 10px;
}

.login-link:hover {
  background: var(--primary-color, #8a2be2);
  color: white;
}

/* Forum Auth Links */
.forum-auth-link {
  display: inline-block;
}

.forum-sign-in:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(233, 30, 99, 0.5);
}

.forum-sign-out:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

/* Pulse animation for sign-in button */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.6);
  }
}

@media (max-width: 768px) {
  .forum-auth-link {
    font-size: 0.85em;
    padding: 8px 16px !important;
  }
  
  .forum-sign-in {
    font-size: 0.9em !important;
    padding: 8px 16px !important;
  }
}

.nav-links li {
  position: relative;
  margin: 0;
}

.nav-links li > a {
  color: var(--theme-text-primary, var(--text-color, #e0e0e0));
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: all 0.3s ease;
  display: block;
  white-space: nowrap;
  font-family: var(--display-font, 'AnimeAce', sans-serif);
  flex-shrink: 0;
}

.nav-links li > a img {
  display: inline-block;
  vertical-align: middle;
  margin-right: 5px;
  object-fit: contain;
  transition: filter 0.3s ease;
}

/* Color glows for nav bar icons based on route */
.nav-links li > a[href="/library"] img,
.nav-links li > a[href*="library"] img {
  filter: drop-shadow(0 0 8px rgba(59, 130, 246, 0.8))
          drop-shadow(0 0 15px rgba(59, 130, 246, 0.6));
}

.nav-links li > a[href="/games-library"] img,
.nav-links li > a[href*="games"] img {
  filter: drop-shadow(0 0 8px rgba(34, 197, 94, 0.8))
          drop-shadow(0 0 15px rgba(34, 197, 94, 0.6));
}

.nav-links li > a[href="/radio"] img,
.nav-links li > a[href*="radio"] img {
  filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.8))
          drop-shadow(0 0 15px rgba(168, 85, 247, 0.6));
}

.nav-links li > a[href="/merchandise"] img,
.nav-links li > a[href*="merchandise"] img {
  filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.8))
          drop-shadow(0 0 15px rgba(249, 115, 22, 0.6));
}

.nav-links li > a[href="/social"] img,
.nav-links li > a[href*="social"] img {
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.8))
          drop-shadow(0 0 15px rgba(6, 182, 212, 0.6));
}

.nav-links li > a[href="/lore-masters"] img,
.nav-links li > a[href*="lore-masters"] img {
  filter: drop-shadow(0 0 8px rgba(234, 179, 8, 0.8))
          drop-shadow(0 0 15px rgba(234, 179, 8, 0.6));
}

/* Enhanced glow on hover */
.nav-links li > a[href="/library"]:hover img,
.nav-links li > a[href*="library"]:hover img {
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.9))
          drop-shadow(0 0 20px rgba(59, 130, 246, 0.7))
          drop-shadow(0 0 30px rgba(59, 130, 246, 0.5));
}

.nav-links li > a[href="/games-library"]:hover img,
.nav-links li > a[href*="games"]:hover img {
  filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.9))
          drop-shadow(0 0 20px rgba(34, 197, 94, 0.7))
          drop-shadow(0 0 30px rgba(34, 197, 94, 0.5));
}

.nav-links li > a[href="/radio"]:hover img,
.nav-links li > a[href*="radio"]:hover img {
  filter: drop-shadow(0 0 12px rgba(168, 85, 247, 0.9))
          drop-shadow(0 0 20px rgba(168, 85, 247, 0.7))
          drop-shadow(0 0 30px rgba(168, 85, 247, 0.5));
}

.nav-links li > a[href="/merchandise"]:hover img,
.nav-links li > a[href*="merchandise"]:hover img {
  filter: drop-shadow(0 0 12px rgba(249, 115, 22, 0.9))
          drop-shadow(0 0 20px rgba(249, 115, 22, 0.7))
          drop-shadow(0 0 30px rgba(249, 115, 22, 0.5));
}

.nav-links li > a[href="/social"]:hover img,
.nav-links li > a[href*="social"]:hover img {
  filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.9))
          drop-shadow(0 0 20px rgba(6, 182, 212, 0.7))
          drop-shadow(0 0 30px rgba(6, 182, 212, 0.5));
}

.nav-links li > a[href="/lore-masters"]:hover img,
.nav-links li > a[href*="lore-masters"]:hover img {
  filter: drop-shadow(0 0 12px rgba(234, 179, 8, 0.9))
          drop-shadow(0 0 20px rgba(234, 179, 8, 0.7))
          drop-shadow(0 0 30px rgba(234, 179, 8, 0.5));
}

.nav-links li > a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary-color, #ffd700);
}

/* Dropdown arrow indicator */
.nav-links li.has-dropdown > a::after {
  content: ' ▼';
  font-size: 0.7em;
  margin-left: 0.3em;
  opacity: 0.7;
}

/* Dropdown System */
.has-dropdown > ul.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(15, 15, 20, 1);
  border: 2px solid var(--primary-color, #ffd700);
  border-radius: 8px;
  min-width: 200px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  padding-top: 0;
  margin-top: 0;
  list-style: none;
  padding: 0;
}

/* Right-align dropdowns in nav-right */
.nav-right .has-dropdown > ul.dropdown {
  left: auto;
  right: 0;
}

/* Bridge the gap to prevent hover loss */
.has-dropdown > ul.dropdown::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 0;
  right: 0;
  height: 5px;
  background: transparent;
}

/* Show dropdown on hover or focus */
.has-dropdown:hover > ul.dropdown,
.has-dropdown:focus-within > ul.dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}

/* Keep dropdown visible while hovering */
.has-dropdown .dropdown:hover {
  opacity: 1;
  visibility: visible;
}

/* Dropdown items */
.has-dropdown .dropdown li {
  margin: 0;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.has-dropdown .dropdown li:last-child {
  border-bottom: none;
}

.has-dropdown .dropdown li a {
  padding: 0.75rem 1.25rem;
  color: var(--theme-text-primary, var(--text-color, #e0e0e0));
  display: block;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.has-dropdown .dropdown li a:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
  color: var(--primary-color, #ffd700);
  padding-left: 1.5rem;
}

.has-dropdown .dropdown li button {
  width: 100%;
  text-align: left;
  padding: 0.75rem 1.25rem;
  background: transparent;
  border: none;
  color: var(--theme-text-primary, var(--text-color, #e0e0e0));
  cursor: pointer;
  font-family: var(--display-font, 'AnimeAce', sans-serif);
  font-size: inherit;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.has-dropdown .dropdown li button:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
  color: var(--primary-color, #ffd700);
  padding-left: 1.5rem;
}

/* Active page highlighting */
.nav-links li a.active {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 165, 0, 0.3));
  color: var(--primary-color, #ffd700);
  border-bottom: 2px solid var(--primary-color, #ffd700);
}

/* Featured Navigation Item */
.featured-nav-item .radio-nav-link {
  background: linear-gradient(135deg, #ec4899, #f97316);
  padding: 10px 20px;
  border-radius: 20px;
  color: #ffd700;
  font-weight: bold;
  border: 2px solid rgba(255, 215, 0, 0.3);
  transition: all 0.3s ease;
}

.featured-nav-item .radio-nav-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
  background: linear-gradient(135deg, #f97316, #ec4899);
}

/* Mobile Menu */
.menu-icon {
  display: none;
  cursor: pointer;
  padding: 10px;
  font-size: 1.5em;
  color: var(--text-color, #e0e0e0);
}

/* Tablet and smaller desktop - prevent overlap */
@media (max-width: 1200px) {
  .nav-links {
    gap: 5px;
  }
  
  .nav-links li > a {
    padding: 0.75rem 1rem;
    font-size: 0.9em;
    color: var(--theme-text-primary, var(--text-color, #e0e0e0));
  }
  
  .nav-right {
    padding-left: 10px;
  }
  
  .nav-left {
    padding-right: 10px;
  }
}

@media (max-width: 768px) {
  .menu-icon {
    display: block;
  }

  .nav-container {
    flex-wrap: wrap;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(30, 30, 40, 0.98);
    flex-direction: column;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    order: 3;
    flex: 1 1 100%;
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-links li > a {
    width: 100%;
    text-align: left;
  }

  .nav-right {
    margin-left: 0;
    order: 2;
  }

  .lore-master-link {
    padding: 0.75rem 1.25rem !important; /* Full padding on mobile */
  }

  .lore-master-link .crown-only {
    display: none;
  }

  .lore-master-link .full-text {
    display: inline;
  }

  .has-dropdown > ul.dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    border: none;
    border-left: 3px solid var(--primary-color, #ffd700);
    margin-left: 1rem;
    margin-top: 0.5rem;
    border-radius: 0;
    background: rgba(30, 30, 40, 0.9);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .has-dropdown.active > ul.dropdown {
    max-height: 500px;
  }

  .has-dropdown > a {
    cursor: pointer;
  }
}

/* Lore Master Link - Show only crown/image by default, full text on hover */
.lore-master-link {
  padding: 0.75rem 0.9rem !important; /* Reduced padding for crown/image */
}

.lore-master-link .full-text {
  display: none;
}

.lore-master-link .crown-only {
  display: inline-block;
}

.lore-master-link .crown-only img {
  display: block;
}

.lore-master-link:hover .crown-only,
.lore-master-link:focus .crown-only,
.lore-master-link.active .crown-only {
  display: none;
}

.lore-master-link:hover .full-text,
.lore-master-link:focus .full-text,
.lore-master-link.active .full-text {
  display: inline;
}

.lore-master-link:hover,
.lore-master-link.active {
  padding: 0.75rem 1.25rem !important; /* Full padding when text shows */
}

