/* ========================================================================== */
/* SHARED NAVIGATION STYLES                                                   */
/* ========================================================================== */

/* Navigation Container */
.nav-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(13, 17, 23, 0.78);
  border-bottom: 1px solid var(--color-border-soft);
  overflow: visible;
  width: 100%;
}

.nav {
  max-width: var(--content-max, 1180px);
  margin: 0 auto;
  padding: 0 clamp(1rem,3vw,2rem);
  height: var(--nav-height, 62px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  gap: 0.4rem;
}

/* All pages now use the same base navigation styles that work perfectly on rankings.html */

/* Brand - additional styling */
.brand {
  font-family: var(--font-head, Poppins, sans-serif);
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--color-text, #e5eaf0);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand svg {
  width: 22px;
  height: 22px;
}

/* Navigation spacer - not needed with grid layout */
.nav-spacer {
  display: none;
}


/* Navigation Links */
.nav-links {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  scrollbar-width: none;
  -ms-overflow-style: none;
  white-space: nowrap;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  padding: 0.6rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.45px;
  color: var(--color-text-muted, #9caab8);
  border-radius: 8px;
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
  transition: color 0.28s, background 0.28s;
}

.nav-links a:hover {
  color: var(--color-text, #e5eaf0);
}

.nav-links a[aria-current="page"] {
  color: var(--color-text, #e5eaf0);
  font-weight: 600;
}

/* Navigation Underline */
.nav-underline {
  position: absolute;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--color-accent, #2f81f7);
  width: 0;
  left: 0;
  transition: left 0.32s, width 0.32s;
  pointer-events: none;
}

/* Tools Dropdown Menu */
.nav-dropdown {
  position: relative;
  display: inline-flex;
}

/* Debug: Make dropdown visible for testing */
.nav-dropdown-menu.debug-visible {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}

.nav-dropdown-toggle {
  padding: 0.6rem 0.95rem;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.45px;
  color: var(--color-text-muted, #9caab8);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.28s, background 0.28s;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-dropdown-toggle:hover {
  color: var(--color-text, #e5eaf0);
}

.nav-dropdown-toggle[aria-current="page"] {
  color: var(--color-text, #e5eaf0);
  font-weight: 600;
}

.nav-dropdown-toggle::after {
  content: '▼';
  font-size: 0.7rem;
  transition: transform 0.28s;
  margin-left: 0.2rem;
}

.nav-dropdown:hover .nav-dropdown-toggle::after {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: #141b24;
  border: 1px solid #1b252e;
  border-radius: 8px;
  padding: 0.8rem 0;
  min-width: 200px;
  width: auto;
  max-width: 250px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.4);
  display: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.28s ease, visibility 0.28s ease, transform 0.28s ease;
  z-index: 99999;
}

.nav-dropdown-menu a {
  display: block;
  padding: 0.9rem 1.2rem;
  color: #e5eaf0;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.28s, background 0.28s;
  border-radius: 0;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.nav-dropdown-menu a:hover {
  color: #ffffff;
  background: #1b252e;
  filter: brightness(1.2);
}

/* Mobile Toggle */
.mobile-toggle {
  display: none;
  border: 1px solid var(--color-border, #202a33);
  background: var(--color-surface-alt, #18222d);
  width: 44px;
  height: 44px;
  border-radius: 8px;
  place-items: center;
  cursor: pointer;
  color: var(--color-text-muted, #9caab8);
  font-size: 1.05rem;
  transition: background 0.28s, color 0.28s, border-color 0.28s;
  flex-shrink: 0;
}

.mobile-toggle:hover {
  background: var(--color-surface, #141b24);
  color: var(--color-text, #e5eaf0);
}

/* Mobile Responsive */
@media (max-width: 920px) {
  .nav {
    flex-wrap: wrap;
    height: auto;
    padding: 0.9rem 1.1rem 1.2rem;
  }
  
  .nav-links {
    order: 3;
    width: 100%;
    flex-direction: column;
    background: var(--color-surface, #141b24);
    border: 1px solid var(--color-border-soft, #1b252e);
    border-radius: 18px;
    padding: 1rem 0.95rem 0.85rem;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: max-height 0.6s, opacity 0.32s, transform 0.28s;
  }
  
  .nav-links.open {
    max-height: 600px;
    opacity: 1;
    transform: none;
  }
  
  .nav-links a {
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 6px;
  }
  
  .nav-underline {
    display: none;
  }
  
  .mobile-toggle {
    display: grid;
    margin-left: auto;
  }
  
  /* Mobile Dropdown Adjustments */
  .nav-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--color-surface-alt, #18222d);
    border-radius: 6px;
    margin-top: 0.5rem;
  }
  
  .nav-dropdown-toggle::after {
    display: none;
  }
}
