/* =====================================================
   GLASS DROPDOWN MENU STYLES
   ===================================================== */

/* Menu Wrapper */
.nav-menu-wrapper {
  position: relative;
}

/* Grid Menu Trigger Button — always dark since nav is always dark */
.nav-grid-menu-trigger {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--white);
  padding: 7px 14px;
  border-radius: 100px;
  cursor: pointer;
  font-family: var(--font-body);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.nav-grid-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}

/* Menu Pill Label */
.menu-pill-label {
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.02em;
}

/* Grid Icon */
.grid-icon {
  width: 18px;
  height: 18px;
  color: var(--white);
  flex-shrink: 0;
}

/* =====================================================
   PREMIUM GLASS DROPDOWN MENU
   ===================================================== */

.menu-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 220px;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.95) 0%,
    rgba(10, 15, 35, 0.92) 100%
  );
  backdrop-filter: blur(150px) saturate(200%) brightness(1.1);
  -webkit-backdrop-filter: blur(150px) saturate(200%) brightness(1.1);
  border: 1px solid rgba(71, 85, 105, 0.25);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(148, 163, 184, 0.08) inset,
    0 2px 4px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.22s ease-out,
              transform 0.22s ease-out,
              visibility 0.22s;
  z-index: 1000;
  /* Force hardware acceleration for better blur rendering */
  will-change: transform, opacity;
  transform: translateZ(0);
}

/* Atmospheric lighting overlay with stronger diffusion */
.menu-dropdown::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(
      circle at 20% 20%,
      rgba(96, 165, 250, 0.1) 0%,
      transparent 50%
    ),
    linear-gradient(
      135deg,
      rgba(148, 163, 184, 0.15) 0%,
      rgba(71, 85, 105, 0.12) 40%,
      rgba(30, 41, 59, 0.08) 100%
    );
  border-radius: 14px;
  pointer-events: none;
  z-index: 0;
}

/* Subtle top edge highlight */
.menu-dropdown::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(148, 163, 184, 0.2) 20%,
    rgba(148, 163, 184, 0.2) 80%,
    transparent 100%
  );
  border-radius: 14px 14px 0 0;
  pointer-events: none;
  z-index: 0;
}

.menu-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown Items */
.dropdown-item {
  display: block;
  padding: 10px 12px;
  color: #FFFFFF;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.18s ease;
  opacity: 0;
  transform: translateY(6px);
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.menu-dropdown.active .dropdown-item {
  opacity: 1;
  transform: translateY(0);
}

/* Premium glass hover state */
.dropdown-item:hover {
  background: linear-gradient(
    135deg,
    rgba(148, 163, 184, 0.2) 0%,
    rgba(71, 85, 105, 0.18) 100%
  );
  color: #FFFFFF;
  padding-left: 16px;
  box-shadow: 
    inset 0 1px 0 rgba(148, 163, 184, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.15);
}

/* =====================================================
   PREMIUM GLASS NESTED SUBMENU
   ===================================================== */

.dropdown-submenu-wrapper {
  position: relative;
  cursor: pointer;
  overflow: visible;
}

.dropdown-item-with-submenu {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.submenu-arrow {
  font-size: 16px;
  margin-left: auto;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.dropdown-submenu-wrapper:hover .submenu-arrow {
  opacity: 1;
}

.dropdown-submenu {
  position: absolute;
  top: 0;
  left: 100%;
  right: auto;
  margin-left: 12px;
  width: auto;
  min-width: max-content;
  background: linear-gradient(
    135deg,
    rgba(15, 23, 42, 0.95) 0%,
    rgba(10, 15, 35, 0.92) 100%
  );
  backdrop-filter: blur(150px) saturate(200%) brightness(1.1);
  -webkit-backdrop-filter: blur(150px) saturate(200%) brightness(1.1);
  border: 1px solid rgba(71, 85, 105, 0.25);
  border-radius: 12px;
  padding: 10px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.5),
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(148, 163, 184, 0.08) inset,
    0 2px 4px rgba(0, 0, 0, 0.4);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-6px);
  transition: opacity 0.18s ease-out,
              transform 0.18s ease-out,
              visibility 0.18s;
  z-index: 1001;
  /* Force hardware acceleration for better blur rendering */
  will-change: transform, opacity;
  transform: translateZ(0);
}

/* Atmospheric lighting overlay for submenu with stronger diffusion */
.dropdown-submenu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(
      circle at 20% 20%,
      rgba(96, 165, 250, 0.1) 0%,
      transparent 50%
    ),
    linear-gradient(
      135deg,
      rgba(148, 163, 184, 0.15) 0%,
      rgba(71, 85, 105, 0.12) 40%,
      rgba(30, 41, 59, 0.08) 100%
    );
  border-radius: 12px;
  pointer-events: none;
  z-index: 0;
}

/* Subtle top edge highlight for submenu */
.dropdown-submenu::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(148, 163, 184, 0.2) 20%,
    rgba(148, 163, 184, 0.2) 80%,
    transparent 100%
  );
  border-radius: 12px 12px 0 0;
  pointer-events: none;
  z-index: 0;
}

.dropdown-submenu-wrapper:hover .dropdown-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.submenu-item {
  display: block;
  padding: 8px 10px;
  color: #FFFFFF !important;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.18s ease;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Premium glass hover state for submenu items */
.submenu-item:hover {
  background: linear-gradient(
    135deg,
    rgba(148, 163, 184, 0.2) 0%,
    rgba(71, 85, 105, 0.18) 100%
  );
  color: #FFFFFF !important;
  box-shadow: 
    inset 0 1px 0 rgba(148, 163, 184, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.15);
}

/* =====================================================
   PREMIUM GLASS MOBILE NAV PANEL
   ===================================================== */

@media (max-width: 768px) {
  /* Dropdown becomes full-width panel below the pill */
  .menu-dropdown {
    position: fixed;
    top: 80px;
    left: 12px;
    right: 12px;
    width: auto;
    border-radius: 16px;
    padding: 16px;
    background: linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.95) 0%,
      rgba(10, 15, 35, 0.92) 100%
    );
    backdrop-filter: blur(150px) saturate(200%) brightness(1.1);
    -webkit-backdrop-filter: blur(150px) saturate(200%) brightness(1.1);
  }

  /* Mobile CTA at top of panel */
  .menu-mobile-cta {
    display: block;
    text-align: center;
    background: linear-gradient(
      135deg,
      rgba(59, 130, 246, 0.9) 0%,
      rgba(37, 99, 235, 0.85) 100%
    );
    color: var(--white) !important;
    padding: 0.75rem 1.5rem;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    margin-bottom: 12px;
    letter-spacing: 0.01em;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
      0 4px 12px rgba(59, 130, 246, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }

  .menu-mobile-cta:hover {
    background: linear-gradient(
      135deg,
      var(--accent-blue) 0%,
      var(--accent-blue-hover) 100%
    );
    transform: translateY(-1px);
    box-shadow: 
      0 6px 16px rgba(59, 130, 246, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }

  /* Submenu on mobile — below instead of to the side */
  .dropdown-submenu {
    position: static;
    margin: 4px 0 0 12px;
    transform: none !important;
    box-shadow: none;
    border: 1px solid rgba(71, 85, 105, 0.2);
    background: linear-gradient(
      135deg,
      rgba(51, 65, 85, 0.5) 0%,
      rgba(30, 41, 59, 0.45) 100%
    );
    backdrop-filter: blur(80px);
    -webkit-backdrop-filter: blur(80px);
    border-radius: 8px;
    padding: 6px;
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, max-height 0.3s ease, visibility 0.2s;
  }

  .dropdown-submenu-wrapper:hover .dropdown-submenu,
  .dropdown-submenu-wrapper.open .dropdown-submenu {
    opacity: 1;
    visibility: visible;
    max-height: 300px;
  }
}

/* Hide mobile CTA on desktop */
@media (min-width: 769px) {
  .menu-mobile-cta {
    display: none;
  }
}
