/* ==========================================================================
   Midmweb Header & Navigation Bar (Exact Replica)
   ========================================================================== */

:root {
  --midm-navy: #002347;
  --midm-blue: #106eea;
  --midm-gold: #ffc107;
  --midm-ink: #1f1f1f;
  --midm-line: #edf0f4;
}

.notice-bar {
  background: var(--midm-navy);
  color: #ffffff;
  text-align: center;
  font: 500 13px/1.4 'Livvic', sans-serif;
  padding: 8px 16px;
  position: relative;
  z-index: 1002;
}

.notice-bar p {
  margin: 0;
}

.notice-bar span,
.notice-bar a {
  color: var(--midm-gold);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-band {
  background: #ffffff;
  border-bottom: 1px solid var(--midm-line);
  position: relative;
  z-index: 1001;
}

.contact-inner {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  text-decoration: none;
}

.brand img {
  height: 60px;
  width: 60px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.contact-items {
  display: flex;
  align-items: center;
  gap: 0;
}

.contact-item {
  font: 500 13px 'Livvic', sans-serif;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 0 21px;
  border-right: 1px solid #e8e8e8;
  color: #555555;
  text-decoration: none;
  transition: color 0.18s ease;
}

.contact-item:last-child {
  border: 0;
  padding-right: 0;
}

.contact-item > i {
  font-size: 22px;
  color: var(--midm-blue);
}

.contact-item span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.contact-item small {
  font-size: 11px;
  color: #8898b2;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.contact-item:hover {
  color: var(--midm-blue);
}

/* Sticky Navigation Bar */
.nav-wrap {
  background: #ffffff;
  border-top: 1px solid #f0f1f4;
  border-bottom: 1px solid var(--midm-line);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.03);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.nav-inner {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
}

.mobile-brand,
.menu-toggle {
  display: none;
}

.mobile-brand img {
  height: 46px;
  width: 46px;
  object-fit: contain;
  border-radius: 6px;
}

.main-nav {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
  font-family: 'Livvic', sans-serif;
  width: 100%;
  justify-content: space-between;
}

.nav-group {
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.nav-link {
  border: 0;
  background: transparent;
  color: var(--midm-ink);
  font: 600 14.5px 'Livvic', sans-serif;
  padding: 20px 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.18s ease;
  text-decoration: none;
}

.nav-link:hover,
.nav-group:hover > .nav-link {
  color: var(--midm-blue);
}

.nav-link i {
  font-size: 11px;
  transition: transform 0.2s ease;
}

.nav-group:hover > .nav-link i {
  transform: rotate(180deg);
}

.nav-contact {
  background: var(--midm-blue);
  color: #ffffff !important;
  border-radius: 4px;
  padding: 9px 18px;
  margin-left: 6px;
  font-weight: 700;
  font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(16, 110, 234, 0.25);
  text-decoration: none;
}

.nav-contact:hover {
  background: var(--midm-navy);
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 35, 71, 0.3);
}

/* Dropdowns */
.nav-dropdown::before,
.training-dropdown::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 0;
  right: 0;
  height: 10px;
}

.nav-dropdown,
.training-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  box-shadow: 0 15px 35px rgba(15, 23, 41, 0.16);
  border-radius: 0 0 8px 8px;
  z-index: 1001;
}

.nav-group:hover > .nav-dropdown,
.nav-group.open > .nav-dropdown,
.nav-group.open > .training-dropdown {
  display: block;
}

.compact-dropdown {
  width: 250px;
  padding: 10px;
  border: 1px solid var(--midm-line);
  border-top: none;
}

.compact-dropdown a {
  display: block;
  padding: 11px 12px;
  border-radius: 4px;
  font: 500 14px 'Livvic', sans-serif;
  color: #334155;
  text-decoration: none;
  transition: all 0.18s ease;
}

.compact-dropdown a:hover {
  background: #f2f6fc;
  color: var(--midm-blue);
  transform: translateX(4px);
}

/* Training Mega Dropdown */
.training-dropdown {
  width: min(1080px, calc(100vw - 40px));
  left: 50%;
  transform: translateX(-50%);
  padding: 14px;
  display: none;
  grid-template-columns: 275px 1fr;
  gap: 14px;
  max-height: 75vh;
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--midm-line);
  border-top: none;
}

.training-nav:hover > .training-dropdown,
.training-nav.open > .training-dropdown {
  display: grid;
}

.training-tiers {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tier {
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  padding: 14px 10px;
  background: #ffffff;
  border: 1px solid #edf0f5;
  border-radius: 8px;
  color: #253858;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Livvic', sans-serif;
}

.tier > i:first-child {
  font-size: 15px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #f2f5fa;
  color: var(--midm-blue);
  flex-shrink: 0;
}

.tier > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.tier b {
  font-size: 13.5px;
  font-weight: 600;
  color: #1c2733;
}

.tier small {
  font-size: 11px;
  color: #8a92a3;
}

.tier .tier-arrow {
  font-size: 11px;
  border: 1px solid #d9dfe8;
  border-radius: 50%;
  height: 26px;
  width: 26px;
  display: grid;
  place-items: center;
  color: #8a92a3;
}

.tier:hover,
.tier.active {
  background: #eaf1ff;
  border-color: #2f6fed;
}

.tier.active b,
.tier:hover b,
.tier.active > i:first-child,
.tier:hover > i:first-child {
  color: #2f6fed;
}

.training-panel {
  background: var(--midm-navy);
  border-radius: 8px;
  padding: 0 13px 13px;
  overflow: hidden;
}

.training-panel-title {
  font: 600 14px 'Livvic', sans-serif;
  color: var(--midm-gold);
  padding: 13px 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.training-list {
  display: none;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 0 16px;
  background: #ffffff;
  border-radius: 8px;
  padding: 13px;
}

.training-list.active {
  display: grid;
}

.training-list a {
  font: 500 13px 'Livvic', sans-serif;
  padding: 10px 2px;
  border-bottom: 1px solid #edf0f5;
  color: #334155;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: color 0.18s ease;
}

.training-list a i {
  color: var(--midm-blue);
  font-size: 12px;
  width: 14px;
}

.training-list a:hover {
  color: var(--midm-blue);
}

.mobile-submenu-toggle {
  display: none;
}

/* Mobile Responsive */
@media (max-width: 900px) {
  .contact-band {
    display: none;
  }

  .nav-inner {
    height: 65px;
    justify-content: space-between;
  }

  .mobile-brand {
    display: block;
  }

  .menu-toggle {
    display: flex;
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    cursor: pointer;
  }

  .menu-toggle span {
    height: 2px;
    width: 23px;
    background: #172640;
    border-radius: 2px;
    transition: 0.2s ease;
  }

  .menu-toggle[aria-expanded="true"] span:first-child {
    transform: translateY(7px) rotate(45deg);
  }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle[aria-expanded="true"] span:last-child {
    transform: translateY(-7px) rotate(-45deg);
  }

  .main-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: calc(100vh - 65px);
    overflow: auto;
    background: #ffffff;
    padding: 8px 22px 25px;
    align-items: stretch;
    flex-direction: column;
    justify-content: flex-start;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.12);
    gap: 0;
  }

  .main-nav.open {
    display: flex;
  }

  .nav-group {
    height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    border-bottom: 1px solid #edf0f4;
  }

  .nav-link {
    width: 100%;
    padding: 15px 4px;
    text-align: left;
    justify-content: flex-start;
    font-size: 15px;
    color: #111111;
    border-bottom: none;
  }

  .nav-contact {
    width: max-content;
    margin: 12px 0;
    padding: 11px 18px;
    align-self: flex-start;
  }

  .nav-dropdown,
  .training-dropdown {
    position: static;
    transform: none;
    width: 100%;
    box-shadow: none;
    border: none;
    border-radius: 0;
    grid-column: 1 / -1;
  }

  .compact-dropdown {
    display: block;
    padding: 0 0 10px 10px;
  }

  .training-dropdown {
    display: none;
    grid-template-columns: 1fr;
    background: #f8fafc;
    padding: 10px;
    margin: 0 0 10px;
    max-height: none;
  }

  .training-nav.open > .training-dropdown {
    display: grid;
  }

  .training-tiers {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tier {
    padding: 10px 8px;
  }

  .tier .tier-arrow {
    display: none;
  }

  .training-panel {
    min-height: 0;
  }

  .training-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mobile-submenu-toggle {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: 0;
    color: #485a75;
    cursor: pointer;
  }

  .training-nav > .nav-anchor {
    grid-column: 1;
  }

  .training-nav > .mobile-submenu-toggle {
    grid-column: 2;
    grid-row: 1;
  }

  .training-nav.open > .mobile-submenu-toggle i {
    transform: rotate(180deg);
  }

  .nav-group:not(.training-nav) .nav-trigger {
    grid-column: 1;
  }
}
