/* ══════════════════════════════════════════════════════════════════════
   NEODUSTRIA PREMIUM MEGA MENU SYSTEM
   Injected globally via @import in style.css
   ══════════════════════════════════════════════════════════════════════ */

/* ── Hide legacy dp-menu for upgraded items ────────────────────────── */
.nd-mega-parent > ul.dp-menu {
  display: none !important;
}

/* ── Top-level nav link enhancement ────────────────────────────────── */
.header-nav .nd-mega-parent > a {
  position: relative;
  transition: color 0.25s;
}

.header-nav .nd-mega-parent.nd-mega-link-active > a {
  color: #168BFF !important;
}

/* Animated underline on active nav item */
.header-nav .nd-mega-parent > a::before {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #168BFF, #005dba);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-nav .nd-mega-parent.nd-mega-link-active > a::before {
  transform: scaleX(1);
}

/* ── Mega Panel ─────────────────────────────────────────────────────── */
.nd-mega-panel {
  position: fixed;
  width: 720px;
  background:
    radial-gradient(ellipse at 60% 0%, rgba(22,139,255,0.06) 0%, transparent 55%),
    linear-gradient(160deg, rgba(3,8,22,0.99) 0%, rgba(5,13,30,0.98) 100%);
  backdrop-filter: blur(36px) saturate(220%);
  -webkit-backdrop-filter: blur(36px) saturate(220%);
  border: 1px solid rgba(22,139,255,0.20);
  border-radius: 24px;
  box-shadow:
    0 0 0 1px rgba(22,139,255,0.04),
    0 0 50px rgba(22,139,255,0.09),
    0 48px 120px rgba(0,0,0,0.88),
    0 8px 40px rgba(0,0,10,0.7);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-10px) scale(0.985);
  transform-origin: top center;
  transition:
    opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 99999;
  overflow: hidden;
}

.nd-mega-panel.nd-mega-visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0) scale(1);
}

/* Atmospheric top glow line */
.nd-mega-top-line {
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(22,139,255,0.55), rgba(0,93,186,0.45), transparent);
  z-index: 2;
  pointer-events: none;
}

/* ── Internal Grid ─────────────────────────────────────────────────── */
.nd-mega-inner {
  display: grid;
  grid-template-columns: 1fr 256px;
  min-height: 220px;
  position: relative;
}

/* Faint vertical separator glow */
.nd-mega-inner::before {
  content: '';
  position: absolute;
  top: 10%;
  bottom: 10%;
  left: calc(100% - 256px - 1px);
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(22,139,255,0.12) 30%, rgba(22,139,255,0.18) 50%, rgba(22,139,255,0.12) 70%, transparent);
  pointer-events: none;
}

/* ── Links Column ──────────────────────────────────────────────────── */
.nd-mega-links {
  padding: 16px 16px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ── Item Card ─────────────────────────────────────────────────────── */
.nd-mega-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none !important;
  cursor: pointer;
  position: relative;
  border: 1px solid transparent;
  min-height: 70px;
  transition:
    border-color 0.25s ease,
    transform 0.22s ease;
}

.nd-mega-item::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, rgba(22,139,255,0.08) 0%, rgba(0,93,186,0.04) 100%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.nd-mega-item:hover {
  border-color: rgba(22,139,255,0.18);
  transform: translateX(3px);
}

.nd-mega-item:hover::before {
  opacity: 1;
}

/* ── Icon Container ────────────────────────────────────────────────── */
.nd-mega-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(22,139,255,0.14) 0%, rgba(0,93,186,0.06) 100%);
  border: 1px solid rgba(22,139,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(91,179,255,0.82);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  transition:
    box-shadow 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease,
    color 0.28s ease;
}

.nd-mega-item:hover .nd-mega-icon {
  box-shadow:
    0 0 0 1px rgba(22,139,255,0.25),
    0 0 20px rgba(22,139,255,0.25),
    inset 0 0 12px rgba(22,139,255,0.08);
  border-color: rgba(22,139,255,0.38);
  background: linear-gradient(145deg, rgba(22,139,255,0.22) 0%, rgba(0,93,186,0.12) 100%);
  color: #005dba;
}

.nd-mega-icon svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ── Item Text ─────────────────────────────────────────────────────── */
.nd-mega-text {
  flex: 1;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.nd-mega-title {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: rgba(235,242,255,0.88);
  letter-spacing: 0.01em;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.nd-mega-item:hover .nd-mega-title {
  color: #fff;
}

.nd-mega-desc {
  display: block;
  font-size: 11.5px;
  color: rgba(169,184,200,0.56);
  line-height: 1.45;
  letter-spacing: 0.015em;
}

/* ── Arrow ─────────────────────────────────────────────────────────── */
.nd-mega-arrow {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 8px;
  border: 1px solid rgba(22,139,255,0.13);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(22,139,255,0.52);
  opacity: 0;
  transform: translateX(-6px);
  position: relative;
  z-index: 1;
  transition:
    opacity 0.22s ease,
    transform 0.26s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.22s,
    border-color 0.22s;
}

.nd-mega-item:hover .nd-mega-arrow {
  opacity: 1;
  transform: translateX(0);
  color: rgba(22,139,255,0.85);
  border-color: rgba(22,139,255,0.28);
}

/* ── Visual Panel ──────────────────────────────────────────────────── */
.nd-mega-visual {
  background:
    radial-gradient(ellipse at 50% 35%, rgba(22,139,255,0.09) 0%, transparent 68%),
    linear-gradient(180deg, rgba(5,12,28,0.6) 0%, rgba(2,5,18,0.85) 100%);
  padding: 28px 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.nd-mega-vis-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(22,139,255,0.14) 0%, transparent 65%);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: ndMegaGlowPulse 4s ease-in-out infinite;
}

@keyframes ndMegaGlowPulse {
  0%, 100% { opacity: 0.7; transform: translate(-50%, -50%) scale(1); }
  50%       { opacity: 1;   transform: translate(-50%, -50%) scale(1.1); }
}

.nd-mega-vis-art {
  width: 116px;
  height: 116px;
  position: relative;
  z-index: 1;
  margin-bottom: 18px;
  filter: drop-shadow(0 0 12px rgba(22,139,255,0.25));
}

.nd-mega-vis-art svg {
  width: 100%;
  height: 100%;
}

.nd-mega-vis-text {
  position: relative;
  z-index: 1;
}

.nd-mega-vis-title {
  font-size: 15px;
  font-weight: 700;
  color: rgba(235,242,255,0.85);
  line-height: 1.5;
  margin: 0 0 8px;
  letter-spacing: 0.025em;
}

.nd-mega-vis-title em {
  color: #168BFF;
  font-style: normal;
  display: block;
}

.nd-mega-vis-sub {
  display: block;
  font-size: 11px;
  color: rgba(169,184,200,0.5);
  line-height: 1.55;
  letter-spacing: 0.02em;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1440px) {
  .nd-mega-panel {
    width: 660px;
  }
  .nd-mega-inner {
    grid-template-columns: 1fr 230px;
  }
}

@media (max-width: 1280px) {
  .nd-mega-panel {
    width: 600px;
  }
  .nd-mega-inner {
    grid-template-columns: 1fr 200px;
  }
  .nd-mega-vis-art {
    width: 90px;
    height: 90px;
  }
  .nd-mega-vis-title {
    font-size: 13.5px;
  }
}

/* Below 1024px: mega panel is hidden, mobile offcanvas handles navigation */
@media (max-width: 1199px) {
  .nd-mega-panel {
    display: none !important;
  }
  .nd-mega-parent > ul.dp-menu {
    display: block !important;
  }
  .header-nav .nd-mega-parent > a::before {
    display: none;
  }
}
