/* ICSA site navigation — scoped to #header.icsa-header */

#header.icsa-header {
  --icsa-nav-accent: #f82249;
  --icsa-nav-navy: #0e1b4d;
  border-bottom: 1px solid transparent;
  transition: background 0.35s ease, border-color 0.35s ease, height 0.35s ease, box-shadow 0.35s ease;
}

#header.icsa-header.header-scrolled,
#header.icsa-header.header-inner {
  background: linear-gradient(180deg, rgba(6, 12, 34, 0.98) 0%, rgba(10, 18, 48, 0.97) 100%);
  border-bottom-color: rgba(248, 34, 73, 0.22);
  box-shadow: 0 10px 30px rgba(6, 12, 34, 0.35);
  height: 110px;
}

/* Logo */
#header.icsa-header #logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

#header.icsa-header #logo a {
  display: flex;
  align-items: center;
  line-height: 0;
}

#header.icsa-header #logo img {
  display: block;
  width: auto;
  margin: 0;
  object-fit: contain;
  object-position: left center;
  transition: height 0.35s ease, max-height 0.35s ease, padding 0.35s ease;
}

/* Home hero — original large logo over banner */
#header.icsa-header:not(.header-scrolled):not(.header-inner) #logo {
  overflow: visible;
}

#header.icsa-header:not(.header-scrolled):not(.header-inner) #logo img {
  height: 250px;
  max-height: none;
  max-width: none;
  padding-top: 40px !important;
}

/* Inner pages + scrolled header — compact logo */
#header.icsa-header.header-inner #logo,
#header.icsa-header.header-scrolled #logo {
  max-height: 100%;
  overflow: hidden;
}

#header.icsa-header.header-inner #logo img,
#header.icsa-header.header-scrolled #logo img {
  height: auto !important;
  max-height: 100px;
  max-width: min(190px, 34vw);
  padding-top: 0 !important;
}

@media (max-width: 992px) {
  #header.icsa-header {
    height: 85px !important;
  }

  #header.icsa-header.header-inner,
  #header.icsa-header.header-scrolled {
    height: 85px !important;
  }

  #header.icsa-header:not(.header-scrolled):not(.header-inner) #logo img {
    height: 90px !important;
    padding-top: 0 !important;
  }

  #header.icsa-header.header-inner #logo img,
  #header.icsa-header.header-scrolled #logo img {
    height: auto !important;
    max-height: 80px;
    max-width: min(150px, 42vw);
    padding-top: 10px !important;
  }
}

/* Only nav links get underline — not CTA button */
#header.icsa-header .icsa-navbar > ul > li > a.nav-link::before {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 6px;
  left: 0;
  right: 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--icsa-nav-accent) 0%, #ff6b84 100%);
  visibility: hidden;
  transition: width 0.3s ease, visibility 0.3s ease;
}

#header.icsa-header .icsa-navbar > ul > li > a.nav-link:hover::before,
#header.icsa-header .icsa-navbar > ul > li:hover > a.nav-link::before,
#header.icsa-header .icsa-navbar > ul > li > a.nav-link.active::before {
  visibility: visible;
  width: 100%;
}

#header.icsa-header .icsa-navbar > ul {
  align-items: center;
  gap: 0;
}

#header.icsa-header .icsa-navbar > ul > li {
  display: flex;
  align-items: center;
  padding: 0 0 0 10px;
}

#header.icsa-header .icsa-navbar a.nav-link,
#header.icsa-header .icsa-navbar a.nav-link:focus {
  position: relative;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  vertical-align: middle;
}

#header.icsa-header .icsa-navbar a.nav-link:hover,
#header.icsa-header .icsa-navbar a.nav-link.active,
#header.icsa-header .icsa-navbar li:hover > a.nav-link {
  color: #fff;
}

/* Winners dropdown toggle — single chevron only */
#header.icsa-header .icsa-navbar .dropdown-toggle::after {
  display: none !important;
  content: none !important;
  border: 0 !important;
  margin: 0 !important;
}

#header.icsa-header .icsa-navbar a.nav-link i {
  line-height: 1 !important;
  margin-left: 0 !important;
}

#header.icsa-header .icsa-navbar .icsa-navbar__chevron {
  margin: 0;
  font-size: 0.65rem;
  line-height: 1;
  opacity: 0.8;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

/* Cancel legacy underline on non-nav-link anchors */
#header.icsa-header .icsa-navbar > ul > li > a:not(.nav-link)::before {
  display: none !important;
}

#header.icsa-header .icsa-navbar .dropdown:hover .icsa-navbar__chevron,
#header.icsa-header .icsa-navbar .dropdown:focus-within .icsa-navbar__chevron {
  transform: rotate(180deg);
}

/* Desktop dropdown */
@media (min-width: 992px) {
  /* Invisible hover bridge — does not affect text alignment */
  #header.icsa-header .icsa-navbar > ul > li.dropdown::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 12px;
  }

  #header.icsa-header .icsa-navbar .dropdown-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 0.45rem 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: linear-gradient(165deg, #0e1b4d 0%, #121f52 100%);
    box-shadow: 0 18px 45px rgba(6, 12, 34, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  /* Invisible bridge covers any remaining gap between trigger and panel */
  #header.icsa-header .icsa-navbar .dropdown-menu::before {
    content: "";
    position: absolute;
    top: -14px;
    left: 0;
    width: 100%;
    height: 14px;
  }

  #header.icsa-header .icsa-navbar .dropdown:hover > .dropdown-menu,
  #header.icsa-header .icsa-navbar .dropdown:focus-within > .dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  #header.icsa-header .icsa-navbar .dropdown-item {
    padding: 0.55rem 1rem;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
    transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
  }

  #header.icsa-header .icsa-navbar .dropdown-item:hover,
  #header.icsa-header .icsa-navbar .dropdown-item.active {
    background: rgba(248, 34, 73, 0.15);
    color: #fff;
    padding-left: 1.15rem;
  }

  #header.icsa-header .icsa-navbar .dropdown-item.text-muted {
    color: rgba(255, 255, 255, 0.45) !important;
  }
}

/* Participate Now CTA */
#header.icsa-header .icsa-navbar__cta {
  display: flex;
  align-items: center;
  margin-left: 0.5rem;
  padding-left: 0.9rem !important;
}

#header.icsa-header .icsa-navbar__cta::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 22px;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
}

#header.icsa-header .icsa-navbar__btn,
#header.icsa-header .icsa-navbar__btn:hover,
#header.icsa-header .icsa-navbar__btn:focus {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0 1.2rem;
  margin: 0;
  border-radius: 6px;
  background: var(--icsa-nav-accent) !important;
  border: none !important;
  box-shadow: 0 6px 18px rgba(248, 34, 73, 0.35);
  color: #fff !important;
  font-family: "Raleway", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  text-decoration: none;
  line-height: 1.2;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

#header.icsa-header .icsa-navbar__btn::before {
  display: none !important;
  content: none !important;
  width: 0 !important;
  visibility: hidden !important;
}

#header.icsa-header .icsa-navbar__btn:hover,
#header.icsa-header .icsa-navbar__btn:focus {
  background: #e0153c !important;
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(248, 34, 73, 0.45);
}

#header.icsa-header .icsa-navbar__btn i {
  font-size: 0.9em;
  line-height: 1;
}

#header.icsa-header.header-scrolled .icsa-navbar a.nav-link,
#header.icsa-header.header-scrolled .icsa-navbar__btn {
  min-height: 40px;
}

@media (max-width: 1199px) {
  #header.icsa-header .icsa-navbar a.nav-link,
  #header.icsa-header .icsa-navbar a.nav-link:focus {
    font-size: 11.5px;
    padding: 7px 7px;
  }

  #header.icsa-header .icsa-navbar__btn {
    padding: 0.55rem 0.9rem;
    font-size: 11px;
  }
}

/* ── Mobile navigation ── */
@media (max-width: 991px) {
  #header.icsa-header .icsa-navbar .dropdown:hover > .dropdown-menu {
    display: none !important;
  }

  #header.icsa-header .icsa-navbar.navbar-mobile {
    background: rgba(6, 12, 34, 0.97);
  }

  #header.icsa-header .icsa-navbar.navbar-mobile > ul {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    top: 72px;
    right: 12px;
    left: 12px;
    bottom: 12px;
    padding: 0.75rem 0 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #0e1b4d 0%, #0a1230 100%);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    overflow-y: auto;
  }

  #header.icsa-header .icsa-navbar.navbar-mobile > ul > li {
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  #header.icsa-header .icsa-navbar.navbar-mobile > ul > li:last-child {
    border-bottom: none;
  }

  #header.icsa-header .icsa-navbar.navbar-mobile a.nav-link,
  #header.icsa-header .icsa-navbar.navbar-mobile a.nav-link:focus {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.95rem 1.15rem;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.9) !important;
  }

  #header.icsa-header .icsa-navbar.navbar-mobile a.nav-link::before {
    display: none !important;
  }

  #header.icsa-header .icsa-navbar.navbar-mobile a.nav-link:hover,
  #header.icsa-header .icsa-navbar.navbar-mobile a.nav-link.active {
    color: #fff !important;
    background: rgba(248, 34, 73, 0.1);
  }

  #header.icsa-header .icsa-navbar.navbar-mobile .dropdown-menu {
    display: none !important;
    position: static !important;
    float: none;
    width: 100%;
    margin: 0 !important;
    padding: 0.25rem 0 0.5rem !important;
    border: none !important;
    border-radius: 0 !important;
    background: rgba(0, 0, 0, 0.2) !important;
    box-shadow: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  #header.icsa-header .icsa-navbar.navbar-mobile .dropdown-menu.dropdown-active {
    display: block !important;
  }

  #header.icsa-header .icsa-navbar.navbar-mobile .dropdown > a[aria-expanded="true"] .icsa-navbar__chevron {
    transform: rotate(180deg);
  }

  #header.icsa-header .icsa-navbar.navbar-mobile .dropdown-item {
    padding: 0.65rem 1.15rem 0.65rem 1.75rem;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.82) !important;
  }

  #header.icsa-header .icsa-navbar.navbar-mobile .dropdown-item:hover,
  #header.icsa-header .icsa-navbar.navbar-mobile .dropdown-item.active {
    background: rgba(248, 34, 73, 0.12) !important;
    color: #fff !important;
    padding-left: 1.9rem;
  }

  #header.icsa-header .icsa-navbar.navbar-mobile .icsa-navbar__cta {
    margin: 0.75rem 1rem 0;
    padding: 0 !important;
    border-bottom: none;
  }

  #header.icsa-header .icsa-navbar.navbar-mobile .icsa-navbar__cta::before {
    display: none;
  }

  #header.icsa-header .icsa-navbar.navbar-mobile .icsa-navbar__btn {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 13px;
    border-radius: 8px;
    text-align: center;
    color: #fff !important;
    background: var(--icsa-nav-accent) !important;
  }

  #header.icsa-header .icsa-navbar.navbar-mobile .icsa-navbar__btn:hover {
    background: #e0153c !important;
    color: #fff !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #header.icsa-header,
  #header.icsa-header .icsa-navbar__btn,
  #header.icsa-header .icsa-navbar .icsa-navbar__chevron,
  #header.icsa-header .icsa-navbar .dropdown-menu,
  #header.icsa-header .icsa-navbar .dropdown-item {
    transition: none;
  }
}
