/* ==========================================
   SHARED HEADER STYLES
   Consistent navigation across all pages
   ========================================== */

/* -------------------------
   Root variables / theme
   ------------------------- */
:root {
  --bg-very-dark: #000000;
  --bg-dark: #0a0a0a;
  --glass: rgba(255,255,255,0.03);
  --accent-start: #ffffff; /* white */
  --accent-end: #888888;   /* gray */
  --accent-mid: #cccccc;
  --muted: #888888;
  --card: rgba(255,255,255,0.03);
  --glass-border: rgba(255,255,255,0.04);
  --glow: 0 8px 40px rgba(255,255,255,0.08);
  --max-width: 1400px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --accent-gradient: linear-gradient(135deg, var(--accent-start), var(--accent-end));
}

/* -------------------------
   Reset + base styles
   ------------------------- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { 
  height: 100%; 
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: var(--bg-very-dark);
  color: #fff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* -------------------------
   Container
   ------------------------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2.5rem;
  position: relative;
  z-index: 10; /* above bg */
}

/* -------------------------
   Header — transparent, glassy, darkens on scroll
   ------------------------- */
.site-header {
  position: fixed;
  top: 16px;
  left: 0;
  right: 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.site-header .nav {
  pointer-events: auto;
  width: 100%;
  max-width: var(--max-width);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.04);
  backdrop-filter: blur(10px) saturate(1.1);
  box-shadow: var(--glow);
  transition: all 220ms ease;
  transform: translateZ(0);
}

/* compact on mobile */
.site-header .nav.compact {
  padding: 0.45rem 0.75rem;
  border-radius: 12px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  color: var(--accent-start);
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, var(--accent-start), var(--accent-end));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 1.05rem;
  text-decoration: none;
}

.logo img {
  height: 36px;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(123,75,255,0.06);
}

/* Navigation sections */
.nav-left, .nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Navigation links */
.nav-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

/* Regular nav links */
.nav-links a {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 6px 8px;
  border-radius: 8px;
  transition: all 180ms ease;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--accent-mid);
  transform: translateY(-3px);
  text-shadow: 0 6px 18px rgba(255,255,255,0.15);
}

.nav-links a.active {
  color: var(--accent-start);
}

/* Mobile dropdown nav links - higher specificity */
.mobile-dropdown .nav-links {
  display: flex !important;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}

.mobile-dropdown .nav-links a {
  display: block !important;
  padding: 14px 16px;
  border-radius: 8px;
  text-align: left;
  color: #ffffff !important;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 180ms ease;
  border: 1px solid transparent;
  background: transparent;
  text-decoration: none;
  pointer-events: auto !important;
  position: relative;
  z-index: 1001;
}

.mobile-dropdown .nav-links a:hover {
  background: rgba(255,255,255,0.1) !important;
  border-color: rgba(255,255,255,0.2);
  color: #ffffff !important;
  transform: translateX(4px);
}

.mobile-dropdown .nav-links a:active {
  background: rgba(255,255,255,0.15) !important;
}

/* Invite/Login button */
.invite-btn {
  background: var(--accent-gradient);
  background-size: 200% 200%;
  color: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(123,75,255,0.12);
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 180ms ease, box-shadow 180ms ease;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  text-decoration: none;
}

.invite-btn i {
  font-size: 1.05rem;
}

.invite-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(123,75,255,0.18);
}

/* Mobile hamburger menu */
.hamburger {
  display: none;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--muted);
  font-size: 1.1rem;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 180ms ease;
}

.hamburger:hover {
  background: rgba(255,255,255,0.1);
  color: var(--accent-mid);
  transform: translateY(-2px);
}

.hamburger:active {
  transform: translateY(0);
}

/* Mobile dropdown menu */
.mobile-dropdown {
  display: none;
  position: fixed;
  top: 90px;
  right: 18px;
  background: rgba(10,10,10,0.98);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.8);
  backdrop-filter: blur(15px);
  z-index: 1000;
  min-width: 200px;
  max-width: 250px;
  pointer-events: auto;
}

.mobile-dropdown.open {
  display: block;
  animation: dropdownSlideIn 0.2s ease-out;
}

@keyframes dropdownSlideIn {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* User info (for dashboard) */
.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
}

.user-info img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.user-info .username {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--accent-start);
}

/* Page content spacing to account for fixed header */
.page-content {
  padding-top: 120px; /* Account for fixed header + some spacing */
}

/* Responsive design */
@media (max-width: 820px) {
  .nav-links {
    display: none;
  }
  
  .hamburger {
    display: inline-block;
  }
  
  .site-header .nav {
    padding: 0.4rem 0.8rem;
  }
  
  .container {
    padding: 0 1rem;
  }
  
  .page-content {
    padding-top: 100px;
  }
}

@media (max-width: 420px) {
  .site-header {
    top: 10px;
  }
  
  .site-header .nav {
    padding: 0.4rem;
  }
  
  .mobile-dropdown {
    right: 10px;
    left: 10px;
    top: 80px;
    max-width: none;
  }
  
  .page-content {
    padding-top: 80px;
  }
}

/* Scroll effects */
.site-header.scrolled .nav {
  backdrop-filter: blur(14px) saturate(1.05);
  background: linear-gradient(180deg, rgba(6,6,6,0.7), rgba(6,6,6,0.6));
  box-shadow: 0 18px 60px rgba(0,0,0,0.7);
}

/* Hide login/dashboard button in desktop header when not needed */
.site-header .invite-btn[href*="dashboard"] {
  display: none !important;
}

/* -------------------------
   Loading Screen
   ------------------------- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #030305;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-screen img {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}