/* =========================================
   HEADER & NAVIGATION (Core Styles)
   ========================================= */
header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 70;
  width: 100%;
  background: linear-gradient(180deg, rgba(0,0,0,0.8), rgba(0,0,0,0));
  border-bottom: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand img {
  width: 60px;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 10px var(--green-glow));
}

/* Island Nav */
.nav-island-wrap {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.nav-island {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  border-radius: 4px;
  padding: 4px;
  transform: skewX(-10deg);
}

.seg {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transform: skewX(10deg);
  transition: all 0.2s ease;
}
.seg:hover {
  color: #fff;
  text-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* =========================================
    CLEAN & VIBRANT ACCENT NAV
    ========================================= */
.seg-accent {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  
  /* Pure background - subtle green tint */
  background: rgba(0, 228, 118, 0.08);
  
  /* Sharp Green Border */
  border: 1px solid var(--accent-green);
  border-radius: 2px;
  
  /* Typography */
  color: var(--accent-green);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  
  /* Clean glow */
  box-shadow: 0 0 10px rgba(0, 228, 118, 0.2);
  
  transition: all 0.2s ease;
  text-decoration: none;
}

.seg-accent:hover {
  /* Full "Power On" look */
  background: var(--accent-green);
  color: #000; /* Invert text for maximum clarity */
  box-shadow: 0 0 20px var(--accent-glow);
}

.seg-accent svg {
  margin-left: 6px;
  transition: transform 0.2s ease;
}

.seg-accent:hover svg {
  transform: translateY(1px);
  filter: brightness(0); /* Makes icon black to match text on hover */
}

/* Mobile Menu Button */
/* Generic Icon Button (Keeps your Socials visible!) */
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  transition: 0.2s;
  cursor: pointer;
}
.icon-btn:hover {
  background: var(--green, #00E676);
  border-color: var(--green, #00E676);
}

/* SPECIFICALLY Hide the Mobile Menu Button on Desktop */
#mobileMenuBtn {
  display: none; 
  z-index: 100; /* Keeps it clickable above the slide-out menu */
}

/* =========================================
   MOBILE MENU DRAWER (Side Swipe)
   ========================================= */
#mobileMenu {
  position: fixed;
  top: 0;
  right: 0;
  width: 100vw;
  height: 100vh;
  z-index: 60; /* Sits just under the header (z-index: 70) */
  display: flex !important; /* Forces flex, but we hide it with transform */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: rgba(3, 3, 3, 0.98);
  backdrop-filter: blur(20px);
  
  /* Start off-screen to the right */
  transform: translateX(100%);
  visibility: hidden; 
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}

/* The Active State triggers the slide-in */
#mobileMenu.show {
  transform: translateX(0);
  visibility: visible;
}

#mobileMenu a {
  display: block;
  padding: 10px 20px;
  color: #e6eef0;
  font-family: var(--font-mono, monospace);
  font-size: 1.8rem; /* Large, bold, centered typography */
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 0.1em;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#mobileMenu a:hover {
  color: var(--accent-green, #00E676);
  transform: scale(1.1);
  text-shadow: 0 0 20px rgba(0,230,118,0.3);
}

/* =========================================
   MEGAMENU (NEW DROPDOWN LOGIC)
   ========================================= */
.megamenu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: rgba(10, 10, 12, 0.98);
  border-bottom: 2px solid var(--green);
  padding: 40px 0;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-20px);
  /* Prevents immediate closing to bridge the hover gap */
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0s linear 0.2s;
  z-index: 50;
  box-shadow: 0 50px 100px rgba(0,0,0,0.9);
  pointer-events: none;
}

/* Invisible bridge to catch the mouse between header and menu */
.megamenu::before {
  content: "";
  position: absolute;
  top: -60px;
  left: 0;
  width: 100%;
  height: 60px;
  background: transparent;
  z-index: 60;
}

/* Trigger showing the menu using modern CSS :has */
header:has(.nav-link-trigger:hover) .megamenu,
header:has(.megamenu:hover) .megamenu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  transition-delay: 0s;
}

.megamenu-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 15px;
}

.mega-card {
  display: block;
  position: relative;
  height: 160px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  text-decoration: none;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 85% 100%, 0 100%);
  transition: all 0.3s ease;
}

.mega-card-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.4s;
}

.mega-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  display: flex;
  align-items: flex-end;
  padding: 10px;
}

.mega-card h5 {
  margin: 0;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.mega-card:hover {
  border-color: var(--green);
  transform: translateY(-5px);
  box-shadow: 0 0 15px var(--green-glow);
}

.mega-card:hover .mega-card-bg {
  transform: scale(1.1);
}

@media (max-width: 1000px) {
  .megamenu { display: none; }
}
/* Auth buttons (Login / Register) */
.auth-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.auth-btn {
  transform: none;              /* cancel island skew */
  padding: 8px 18px;
  border-radius: 4px;
  font-size: 12px;
}

/* Optional hover polish */
.auth-btn.seg-ghost:hover {
  background: rgba(255,255,255,0.08);
}
/* =========================================
   MOBILE BREAKPOINT (CRITICAL FIX)
   ========================================= */
@media (max-width: 1000px) {
  /* Hide the desktop nav island, auth buttons, and megamenu */
  .nav-island-wrap,
  .auth-actions,
  .megamenu {
    display: none !important;
  }

  /* Show the mobile hamburger button */
  .icon-btn, #mobileMenuBtn {
    display: grid !important;
  }
}