/* === Header Styling === */
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(to bottom, #000000, #0A0A0A); /* Black gradient background */
  border-bottom: 3px solid #0085CA; /* Electric blue accent line */
  position: sticky;
  top: 0;
  z-index: 999;
  gap: 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); /* Subtle header shadow */
}

/* Container for logo and hamburger button */
.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Left - Logo */
.header-left h2 a {
  text-decoration: none;
  font-weight: bold;
  color: #0085CA; /* Carolina Blue text */
  font-size: 1.5rem;
  letter-spacing: 1px;
  transition: color 0.3s;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4); /* Slight text shadow for depth */
}

.header-left h2 a:hover {
  color: #00AEEF; /* Lighter accent blue on hover */
}

/* Center - Nav Menu */
.header-center {
  display: flex;
  align-items: center;
  gap: 25px;
  flex-grow: 1;
  justify-content: center;
}

.nav-item {
  position: relative;
}

.nav-link {
  background: none;
  border: none;
  cursor: pointer;
  font-weight: bold;
  color: #0085CA;
  font-size: 1rem;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  text-decoration: none; /* REMOVE UNDERLINE */
  transition: background 0.3s, color 0.3s, transform 0.2s;
  display: inline-block;
  vertical-align: middle;
  line-height: 1; /* Normalizes text alignment between links and buttons */
  text-decoration: none; 
}


.nav-link:hover {
  background-color: rgba(0, 133, 202, 0.15);
  transform: translateY(-1px);
}

/* Underline Animation on Hover */
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #0085CA;
  transition: width 0.3s ease, left 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
  left: 0;
}

/* Dropdown Menus */
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px; /* same spacing everywhere */
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #0085CA;
  border-radius: 8px;
  display: none;
  flex-direction: column;
  min-width: 200px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(5px);
  z-index: 1000;
}


.dropdown-menu a,
.dropdown-menu .dropdown-item {
  padding: 10px 15px;
  text-decoration: none;
  color: #0085CA;
  font-size: 0.95rem;
  white-space: nowrap;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-radius 0.2s;
}

.dropdown-menu a:hover,
.dropdown-menu .dropdown-item:hover {
  background-color: #f0f0f0;
  border-radius: 8px; /* Rounded corners on hover */
}

/* Show dropdown on hover */
.nav-item:hover .dropdown-menu,
.dropdown-wrapper:hover .dropdown-menu {
  display: flex;
}

.dropdown-wrapper {
  position: relative; /* Add this */
}


/* Dropdown hover buffer */
.dropdown-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  width: 100%;
  height: 8px;
}

/* Right - Credits & Settings */
.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.credits-link {
  text-decoration: none;
}

.credits-container {
  color: #0085CA;
  font-weight: bold;
  min-width: 100px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.snowflakes-container {
  color: #00AEEF;
  font-weight: bold;
  min-width: 100px;
  text-align: right;
  overflow: hidden; /* keep within header */
  text-overflow: ellipsis;
}

.snowflakes-link {
  text-decoration: none;
}

/* Settings Button */
.dropdown-toggle {
  background: #0085CA;
  color: #ffffff;
  padding: 8px 12px;
  border: 2px solid #0085CA;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.2s;
  margin: 0; /* ensure no extra spacing! */
}


.dropdown-toggle:hover {
  background: #00AEEF;
  border-color: #00AEEF;
  transform: translateY(-1px);
}

/* Align Settings dropdown to the right */
.header-right .dropdown-menu {
  right: 0;
  left: auto;
  margin-top: 4px; /* same as others! */
}

/* Mobile styles */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: #00AEEF;
  font-size: 1.8rem;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  position: absolute;
  top: 60px;
  right: 10px;
  background: #000;
  border: 1px solid #0085CA;
  border-radius: 8px;
  padding: 10px;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  max-height: 80vh;
  overflow-y: auto;
}

.mobile-menu a,
.mobile-menu button,
.mobile-menu span {
  color: #00AEEF;
  text-decoration: none;
  padding: 6px 0;
  display: block;
}

.mobile-menu.open {
  display: flex;
}

@media (max-width: 768px) {
  .site-header {
    flex-wrap: wrap; /* allow stacking */
    gap: 4px; /* tighter spacing */
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .header-left {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .header-left h2 {
    margin: 0;
  }

  .header-right {
    width: 100%;
    order: 1; /* place under logo */
    justify-content: center; /* center stats */
  }

  .header-center {
    display: none;
  }
  .dropdown-wrapper {
    display: none;
  }
  .hamburger-btn {
    display: block;
  }

  .header-right {
    gap: 4px; /* tighter spacing on small screens */
  }
  .credits-container,
  .snowflakes-container {
    min-width: 0; /* allow shrinking */
    font-size: 0.85rem;
    max-width: 80px; /* prevent overflow */
    text-align: center; /* align text */
  }

  .user-stats {
    flex-direction: row; /* keep stats side by side */
    align-items: center;
    gap: 6px;
  }

  .user-stats a {
    margin-right: 4px;
  }

  .credit-label {
    display: none; /* hide text on small screens */
  }
}

.mobile-menu .mobile-auth-btn {
  width: 100%;
  text-align: left;
  margin: 4px 0;
}

