/* Header Navigation & Mobile Menu */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(14, 16, 21, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--accent-blurple), var(--accent-purple));
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: var(--shadow-glow);
}

.logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 2px 8px rgba(88, 101, 242, 0.4));
  transition: transform 0.2s ease;
}

.logo-container:hover .logo-img {
  transform: scale(1.05);
}

.logo-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-badge {
  font-size: 0.7rem;
  background: var(--accent-blurple);
  color: #fff;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
  color: #fff;
  background: var(--accent-blurple);
}

/* Discord Auth Button & User Profile in Nav */
.user-nav-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-discord-login {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #5865F2;
  color: #ffffff;
  padding: 0.45rem 0.95rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.3);
}

.btn-discord-login:hover {
  background: #4752C4;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(88, 101, 242, 0.45);
}

.discord-icon {
  width: 18px;
  height: 18px;
}

/* Online Users Counter Badge - Ultra Modern Glass Capsule */
.online-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(22, 24, 29, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #dbdee1;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: default;
  user-select: none;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.online-counter-badge:hover {
  background: rgba(30, 32, 38, 0.9);
  border-color: rgba(35, 165, 90, 0.4);
  box-shadow: 0 6px 18px rgba(35, 165, 90, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.online-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #23a55a;
  box-shadow: 0 0 8px #23a55a, 0 0 14px rgba(35, 165, 90, 0.6);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0% { transform: scale(0.92); opacity: 0.85; }
  50% { transform: scale(1.2); opacity: 1; box-shadow: 0 0 12px #23a55a, 0 0 18px rgba(35, 165, 90, 0.8); }
  100% { transform: scale(0.92); opacity: 0.85; }
}

/* Discord Style User Nav & Dropdown Card */
.user-profile-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.user-avatar-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 31, 34, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 4px 12px 4px 5px;
  cursor: pointer;
  color: #f2f3f5;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  outline: none;
}

.user-avatar-trigger:hover,
.user-avatar-trigger.active {
  background: #2b2d31;
  border-color: #5865f2;
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.3);
  transform: translateY(-1px);
}

.avatar-img-container {
  position: relative;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
}

.user-nav-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-status-indicator {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-status-indicator svg,
.discord-avatar-status svg {
  width: 100%;
  height: 100%;
  display: block;
}

.user-display-name {
  color: #f2f3f5;
  font-size: 0.88rem;
  font-weight: 600;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chevron-arrow-icon {
  color: #949ba4;
  transition: transform 0.2s ease;
}

.user-avatar-trigger.active .chevron-arrow-icon {
  transform: rotate(180deg);
  color: #5865f2;
}

/* Discord Dropdown Menu Overlay */
.discord-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background: #232428;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.96);
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 2000;
}

.discord-user-dropdown.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.discord-dropdown-banner {
  height: 96px;
  background: linear-gradient(135deg, #5865F2 0%, #404eed 50%, #2b2d31 100%);
  width: 100%;
  background-size: cover;
  background-position: center;
  position: relative;
}

.discord-banner-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 5;
}

.discord-banner-act-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.22s ease;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  padding: 0;
  opacity: 0.8;
}

.discord-banner-act-btn:hover {
  opacity: 1;
  background: rgba(88, 101, 242, 0.9);
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(88, 101, 242, 0.45);
}

.discord-dropdown-header {
  padding: 0 14px 12px 14px;
  margin-top: -30px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
  position: relative;
}

.discord-avatar-large-wrapper {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid #232428;
  background: #1e1f22;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.discord-avatar-large {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.discord-avatar-status {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border: 3px solid #232428;
  border-radius: 50%;
  background: #232428;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Discord Status Selector inside Dropdown */
.discord-status-selector {
  padding: 8px 12px;
}

.discord-status-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: #949ba4;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.discord-status-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.discord-status-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: #b5bac1;
  transition: all 0.15s ease;
}

.discord-status-opt svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.discord-status-opt:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.discord-status-opt.active {
  background: rgba(88, 101, 242, 0.2);
  border-color: rgba(88, 101, 242, 0.45);
  color: #ffffff;
}

.discord-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 2px;
}

.discord-global-name {
  font-weight: 700;
  font-size: 1rem;
  color: #f2f3f5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.discord-username-tag {
  font-size: 0.8rem;
  color: #949ba4;
  font-weight: 500;
}

.discord-dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 4px 8px;
}

.discord-dropdown-menu-list {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.discord-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #dbdee1;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
}

.discord-menu-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.discord-menu-icon {
  width: 18px;
  height: 18px;
  color: #949ba4;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.discord-menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.discord-menu-item:hover .discord-menu-icon {
  color: #ffffff;
}

.discord-menu-item.logout-item {
  color: #f23f43;
}

.discord-menu-item.logout-item .discord-menu-icon {
  color: #f23f43;
}

.discord-menu-item.logout-item:hover {
  background: rgba(242, 63, 67, 0.15);
  color: #f23f43;
}

.discord-badge-pill {
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.discord-badge-pill.api-key {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.discord-badge-pill.admin {
  background: rgba(129, 140, 248, 0.2);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.4);
}

/* Discord Auth Gate Modal */
.auth-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 6, 12, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.auth-modal-card {
  background: #1e202b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 2.5rem 2rem;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  position: relative;
  animation: modalPop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.auth-modal-icon {
  margin: 0 auto 1.25rem auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-modal-logo-img {
  width: 76px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
  transition: transform 0.3s ease;
}

.auth-modal-logo-img:hover {
  transform: translateY(-2px) scale(1.04);
}



.auth-modal-card h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ffffff 30%, #c7d2fe 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.7rem;
  letter-spacing: -0.5px;
}

.auth-modal-card p {
  color: #94a3b8;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.btn-modal-discord {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(135deg, #5865F2 0%, #4752C4 100%);
  color: #ffffff;
  padding: 0.95rem 1.8rem;
  border-radius: 14px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05rem;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 8px 25px rgba(88, 101, 242, 0.45);
}

.btn-modal-discord:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(88, 101, 242, 0.65);
  background: linear-gradient(135deg, #6975f3 0%, #515cd4 100%);
}


.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-main);
  font-size: 1.5rem;
  cursor: pointer;
}

.search-box-header {
  position: relative;
  width: 220px;
}

.search-box-header input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-main);
  font-size: 0.85rem;
  outline: none;
  transition: all 0.2s ease;
}

.search-box-header input:focus {
  border-color: var(--accent-blurple);
  box-shadow: 0 0 10px rgba(88, 101, 242, 0.3);
}

.search-icon-svg {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: var(--text-sub);
}

@media (max-width: 960px) {
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: 1rem;
  }

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

  .mobile-toggle {
    display: block;
  }

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

  .search-box-header {
    width: 100%;
    margin-top: 0.5rem;
  }
}

@media (max-width: 600px) {
  .navbar {
    padding: 0.6rem 0.85rem;
  }
  .logo-title {
    font-size: 1.15rem;
  }
  .logo-img {
    width: 32px;
    height: 32px;
  }
  .user-nav-wrapper {
    gap: 6px;
  }
}
