/* Alpha user warning banner */
.alpha-warning-banner {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
  border-bottom: 2px solid #ff4757;
  box-shadow: 0 2px 4px rgba(255, 71, 87, 0.3);
  width: 100%;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 1001;
  box-sizing: border-box;
}

.alpha-warning-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
}

.alpha-warning-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.alpha-warning-text {
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Light mode styles for warning banner */
body.light-mode .alpha-warning-banner {
  background: linear-gradient(135deg, #ff8787 0%, #ff6b9d 100%);
  border-bottom: 2px solid #ff4757;
}

body.light-mode .alpha-warning-text {
  color: #ffffff;
}

div.topnav-container {
  background-color: #0b0c10;
  border-bottom: 2px solid #45a29e;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: visible;
}

/* Adjust topnav position when warning banner is present */
.alpha-warning-banner ~ .topnav-container {
  top: 0;
}

/* Modern flexbox layout for topnav */
.topnav-container {
  display: flex;
  flex-direction: column;
}

.topnav-main {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  min-height: 60px;
  gap: 20px;
  overflow: visible;
  position: relative;
}

/* Left links container */
div.topnav-container .leftlinks-container {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: flex-start;
}

div.topnav-container .leftlinks-container a {
  display: inline-block;
  color: #c5c6c7;
  text-align: center;
  padding: 10px 10px;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  border-radius: 6px;
  position: relative;
}

div.topnav-container .leftlinks-container a:hover {
  background-color: #1f2833;
  color: #66fcf1;
}

/* Right links container */
div.topnav-container .rightlinks-container {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: visible;
  flex: 1;
  justify-content: flex-end;
}

div.topnav-container .rightlinks-container a {
  display: inline-block;
  color: #c5c6c7;
  text-align: center;
  padding: 10px 10px;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  border-radius: 6px;
  position: relative;
}

div.topnav-container .rightlinks-container a:hover {
  background-color: #1f2833;
  color: #66fcf1;
}

/* Username dropdown */
.username-dropdown {
  position: relative;
  display: inline-block;
  overflow: visible;
}

.username-link {
  cursor: pointer;
}

.dropdown-menu {
  display: none;
  position: fixed;
  background-color: #1f2833;
  border: 1px solid #45a29e;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 180px;
  width: auto;
  z-index: 10000;
  margin-top: 4px;
  overflow: hidden;
  flex-direction: column;
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-menu a {
  display: block;
  padding: 12px 20px;
  color: #c5c6c7;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 0;
  text-align: left;
  white-space: nowrap;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu a:hover {
  background-color: #2a3441;
  color: #66fcf1;
}

.dropdown-menu a:first-child {
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
}

.dropdown-menu a:last-child {
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
}

/* Light mode for dropdown */
body.light-mode .dropdown-menu {
  background-color: var(--bg-primary, #ffffff);
  border-color: var(--border-color, #45a29e);
}

body.light-mode .dropdown-menu a {
  color: var(--text-primary, #333333);
}

body.light-mode .dropdown-menu a:hover {
  background-color: var(--hover-bg, #e8e8e8);
  color: var(--text-accent, #2c7873);
}

/* Theme Toggle Styles */
.theme-toggle-container {
  display: flex;
  align-items: center;
  margin-right: 8px;
  padding: 4px;
}

.theme-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.theme-icon {
  font-size: 18px;
  transition: opacity 0.3s ease;
}

.theme-toggle-checkbox {
  display: none;
}

.theme-toggle-slider {
  position: relative;
  width: 50px;
  height: 24px;
  background-color: #1f2833;
  border-radius: 24px;
  transition: background-color 0.3s ease;
  border: 2px solid #45a29e;
}

.theme-toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: #66fcf1;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  transition: transform 0.3s ease;
}

.theme-toggle-checkbox:checked + .theme-toggle-slider {
  background-color: #f0f0f0;
  border-color: #45a29e;
}

.theme-toggle-checkbox:checked + .theme-toggle-slider::before {
  transform: translateX(26px) translateY(-50%);
  background-color: #45a29e;
}

body.light-mode .theme-toggle-slider {
  background-color: #f0f0f0;
  border-color: #45a29e;
}

body.light-mode .theme-toggle-slider::before {
  background-color: #45a29e;
}




/* Change color on hover */
.topnav a:hover {
  background-color: #1f2833;
  color: #66fcf1;
}

/* Add active class to the current page link */
.topnav a.active,
div.topnav-container .leftlinks-container a.active,
div.topnav-container .rightlinks-container a.active {
  background-color: #66fcf1;
  color: #0b0c10;
  font-weight: 600;
}

/* Modern search container - now in topnav-main */
.search-container {
  display: flex;
  align-items: center;
  width: 400px;
  flex-shrink: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.search-container form {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

/* Modern search input */
.search-container input[type="text"] {
  flex: 1;
  padding: 8px 100px 8px 14px; /* Extra right padding for button */
  border: 2px solid #45a29e;
  border-radius: 6px;
  background-color: #1f2833;
  color: #c5c6c7;
  font-size: 14px;
  outline: none;
  width: 100%;
}

.search-container input[type="text"]:focus {
  border-color: #66fcf1;
  background-color: #2a3441;
  box-shadow: 0 0 0 3px rgba(102, 252, 241, 0.1);
}

.search-container input[type="text"]::placeholder {
  color: #7a7a7a;
}

/* Modern search button - positioned inside the input */
.search-container button {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  padding: 6px 16px;
  border: none;
  border-radius: 4px;
  background: linear-gradient(135deg, #66fcf1 0%, #45a29e 100%);
  color: #0b0c10;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  box-shadow: 0 2px 4px rgba(102, 252, 241, 0.2);
  white-space: nowrap;
  height: calc(100% - 8px); /* Slightly smaller than input height */
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-container button:hover {
  background: linear-gradient(135deg, #45a29e 0%, #66fcf1 100%);
  box-shadow: 0 4px 8px rgba(102, 252, 241, 0.3);
}

/* Modern sub-navigation */
.subnav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  background-color: rgba(31, 40, 51, 0.5);
  padding: 12px 20px;
  border-top: 1px solid rgba(69, 162, 158, 0.3);
  gap: 10px;
}

/* Style the links inside the sub-navigation */
.subnav > a {
  display: inline-block;
  color: #c5c6c7;
  text-align: center;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  border: 1px solid #45a29e;
  width: 80px;
}

/* Change color on hover */
.subnav > a:hover {
  background-color: #1f2833;
  color: #66fcf1;
}

/* Add active class to the current page link */
.subnav > a.active {
  background: linear-gradient(135deg, #66fcf1 0%, #45a29e 100%);
  color: #0b0c10;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(102, 252, 241, 0.3);
}

/* Subcategories navigation container - separate row below main categories */
.subcategories-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  background-color: rgba(31, 40, 51, 0.5);
  padding: 8px 20px;
  border-top: 1px solid rgba(69, 162, 158, 0.2);
  gap: 6px;
}

/* Subcategory links */
.subcategory-link {
  display: inline-block;
  color: #c5c6c7;
  text-decoration: none;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.subcategory-link:hover {
  color: #66fcf1;
  background-color: rgba(102, 252, 241, 0.1);
}

.subcategory-link.active {
  color: #66fcf1;
  background-color: rgba(102, 252, 241, 0.2);
  font-weight: 600;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .topnav-main {
    flex-wrap: wrap;
    padding: 10px 15px;
    gap: 10px;
  }
  
  .leftlinks-container {
    flex-wrap: wrap;
    gap: 2px;
  }
  
  div.topnav-container .leftlinks-container a,
  div.topnav-container .rightlinks-container a {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .search-container {
    width: 100%;
    order: 3;
    margin-top: 10px;
    position: static;
    left: auto;
    transform: none;
  }
  
  .search-container input[type="text"] {
    font-size: 16px; /* Prevents zoom on iOS */
    padding-right: 90px; /* Adjust for smaller button on mobile */
  }
  
  .search-container button {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .subnav {
    padding: 10px 15px;
    gap: 2px;
  }
  
  .subnav a {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .theme-toggle-container {
    margin-right: 4px;
  }
  
  .theme-toggle-label {
    gap: 4px;
  }
  
  .theme-icon {
    font-size: 16px;
  }
  
  .dropdown-menu {
    min-width: 160px;
  }
  
  .dropdown-menu a {
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .topnav-main {
    padding: 8px 10px;
    min-height: 50px;
  }
  
  div.topnav-container .leftlinks-container a,
  div.topnav-container .rightlinks-container a {
    padding: 6px 10px;
    font-size: 12px;
  }
  
  .search-container {
    margin-top: 8px;
    position: static;
    left: auto;
    transform: none;
  }
  
  .subnav {
    padding: 8px 10px;
  }
  
  .subnav a {
    padding: 5px 10px;
    font-size: 11px;
  }
  
  .theme-toggle-slider {
    width: 44px;
    height: 22px;
  }
  
  .theme-toggle-slider::before {
    width: 16px;
    height: 16px;
  }
  
  .theme-toggle-checkbox:checked + .theme-toggle-slider::before {
    transform: translateX(22px) translateY(-50%);
  }
}