/**
 * Header / Masthead
 * Figma: Nav Headers component – node I114:16965
 *
 * Exact specs from Figma file 7pkrqYlY3BN2AU8jtf43oM
 * - Height:  ~109px  (padding 24px top/bottom)
 * - BG:      #FFFFFF
 * - Border:  1px solid #D4D9DD (bottom only)
 * - Font:    Manrope throughout
 * - Nav active color:   #526070  SemiBold 600
 * - Nav inactive color: #6B7A86  Regular 400
 * - Nav gap: 40px between items
 */

/* =============================================
   MASTHEAD WRAPPER
   ============================================= */

.masthead {
  background: #ffffff;
  border-bottom: 1px solid #d4d9dd;
  padding: 24px 0;
  position: relative;
  z-index: 1000;
}

/* =============================================
   HEADER ROW
   ============================================= */

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
}

/* =============================================
   LOGO
   ============================================= */

.header-logo {
  flex: 0 0 auto;
}

.logo-container {
  display: flex;
  align-items: center;
}

.logo-container img {
  height: 60px;
  width: auto;
}

.logo:hover {
  opacity: 0.9;
  text-decoration: none;
}

/* =============================================
   DESKTOP NAV
   Figma: gap 40px between items, Manrope 16px
   Active: #526070 SemiBold 600
   Inactive: #6B7A86 Regular 400
   ============================================= */

.header-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
}

.eoc-nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 40px;
}

/* Override CKAN's build_nav_main li margin */
.eoc-nav-menu li,
.eoc-nav-menu li.active {
  margin: 0;
}

.eoc-nav-menu li a {
  font-family: "Manrope", sans-serif;
  font-size: 16px;
  font-weight: 400;
  color: #6b7a86 !important;
  text-decoration: none;
  line-height: 24px;
  padding: 0;
  display: inline;
  transition: color 0.15s ease;
}

.eoc-nav-menu li a:hover,
.eoc-nav-menu li a:focus {
  color: #526070 !important;
  text-decoration: none;
}

/* Active link */
.eoc-nav-menu li.active a {
  font-weight: 600;
  color: #526070 !important;
}

/* =============================================
   DESKTOP ACTIONS
   Right side: Language | divider | Bell | divider | User pill
   ============================================= */

.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ── Vertical divider ── */
.header-divider {
  display: block;
  width: 1px;
  height: 40px;
  background: #d4d9dd;
  flex-shrink: 0;
}

/* ── Language selector ── */
.header-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 0;
}

.header-lang__icon {
  flex-shrink: 0;
  color: #526070;
}

.header-lang__label {
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #526070;
  line-height: 1;
}

.header-lang__chevron {
  flex-shrink: 0;
  color: #526070;
}

/* ── Notification bell ── */
.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  text-decoration: none;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.header-icon-btn:hover {
  background: #f9fafb;
  text-decoration: none;
}

.header-icon-btn svg {
  display: block;
}

/* Red dot badge for unread notifications */
.header-icon-btn__dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d90078;
  border: 1.5px solid #ffffff;
}

.header-icon-btn--muted {
  cursor: default;
  pointer-events: none;
}

/* ── User pill ── */
.header-user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 16px 4px 4px;
  border-radius: 50px;
  border: 1px solid #d4d9dd;
  background: #ffffff;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #333333;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
  white-space: nowrap;
}

.header-user-pill:hover,
.header-user-pill:focus {
  border-color: #526070;
  text-decoration: none;
  color: #333333;
}

/* Login variant — filled green */
.header-user-pill--login {
  background: #006246;
  border-color: #006246;
  color: #ffffff !important;
  padding: 8px 20px;
  font-weight: 600;
}

.header-user-pill--login:hover {
  background: #005238;
  border-color: #005238;
  color: #ffffff !important;
}

/* Avatar inside pill */
.header-user-pill__avatar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.header-user-pill__avatar img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.header-user-pill__name {
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #333333;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-user-pill__caret {
  flex-shrink: 0;
  color: #6b7a86;
  transition: transform 0.2s ease;
}

.header-user-dropdown.open .header-user-pill__caret {
  transform: rotate(180deg);
}

/* ── Dropdown menu ── */
.header-user-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid #eaecf0;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  min-width: 200px;
  padding: 6px 0;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease,
    visibility 0.15s;
}

.dropdown.open .dropdown-menu,
.header-user-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  margin: 0;
  list-style: none;
}

.dropdown-menu li a {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #333333 !important;
  text-decoration: none;
  transition: background 0.12s ease;
}

.dropdown-menu li a:hover {
  background: #f9fafb;
  color: #333333 !important;
  text-decoration: none;
}

.dropdown-menu li a i {
  width: 16px;
  font-size: 14px;
  color: #98a2b3;
  flex-shrink: 0;
}

.dropdown-menu li a:hover i {
  color: #526070;
}

.dropdown-divider {
  border-top: 1px solid #eaecf0 !important;
  margin: 4px 0 !important;
  padding: 0 !important;
}

/* Badge for notifications count */
.dropdown-menu .badge {
  background: #d90078;
  color: #ffffff;
  border-radius: 50%;
  padding: 2px 6px;
  font-size: 11px;
  margin-left: auto;
}

/* =============================================
   MOBILE
   ============================================= */

.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

.navbar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 4px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 4px;
}

.navbar-toggle .fa-bars {
  color: #526070;
  font-size: 18px;
}

.mobile-nav {
  display: none;
  background: #ffffff;
  border-bottom: 1px solid #d4d9dd;
  width: 100%;
}

.mobile-nav.open {
  display: block;
}

.mobile-nav nav {
  padding: 12px 0 16px;
}

.mobile-nav .eoc-nav-menu {
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.mobile-nav .eoc-nav-menu li {
  margin: 0;
  border-bottom: 1px solid #f2f4f7;
}

.mobile-nav .eoc-nav-menu li a {
  display: block !important;
  padding: 12px 0;
  font-size: 15px;
}

.mobile-login {
  padding: 16px 0 4px;
}

/* Mobile search panel */
.mobile-search-panel {
  display: none;
  background: #ffffff;
  padding: 12px 0;
  border-top: 1px solid #f2f4f7;
  border-bottom: 1px solid #f2f4f7;
}

.mobile-search-panel.active {
  display: block;
}

.search-input-container {
  position: relative;
  display: flex;
  align-items: center;
  height: 40px;
  border: 1px solid #d4d9dd;
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.search-input {
  flex: 1;
  height: 100%;
  border: none;
  padding: 0 12px;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  color: #333333;
  outline: none;
}

.search-input::placeholder {
  color: #98a2b3;
}

.search-close {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #98a2b3;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* =============================================
   RESPONSIVE BREAKPOINTS
   ============================================= */

@media (max-width: 991px) {
  .logo-container img {
    height: 50px;
  }

  .eoc-nav-menu {
    gap: 24px;
  }

  .header-lang__label {
    display: none; /* hide label text, keep icon */
  }
}

@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  .navbar-toggle {
    display: flex;
  }

  .masthead {
    padding: 16px 0;
  }

  .logo-container img {
    height: 40px;
  }

  .header-row {
    justify-content: space-between;
  }
}
