/* ==========================================================
   AcademicFree Theme — Balanced Header Layout
   ========================================================== */

/* --- Topbar (Login/Register) --- */
.topbar-thin {
  background: #fafbfd;
  border-bottom: 1px solid #e2e6eb;
  font-size: 0.9rem;
  padding: 4px 0;
}
.topbar-thin .container {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.topbar-thin .user-menu a {
  color: #2F4C7A !important;
  text-decoration: none;
  font-weight: 500;
  margin-left: 12px;
}
.topbar-thin .user-menu a:hover { color: #B25E3B; }

/* --- Logo Row with Background Banner (Logo Left) --- */
.logo-row {
  position: relative;
  width: 100%;
  height: 140px; /* same height as your layout */
  background-color: #ffffff; /* fallback */
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  border-bottom: 1px solid #e5e9ef;
  display: flex;
  align-items: center; /* vertically center logo */
}

/* optional overlay for clarity */
.logo-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  z-index: 0;
}

/* keep logo left-aligned */
.logo-row .container {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
}

/* logo itself */
.institution-logo {
  max-height: 150px;
  height: auto;
  width: auto;
  margin-left: 10px;
}

/* responsive banner height */
@media (max-width: 768px) {
  .logo-row {
    height: 180px;
  }
}

/* --- Navigation Bar --- */
.site_header {
  background: #fff;
  border-bottom: 1px solid #dfe3e7;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  padding: 12px 0;
}
.site_header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  max-width: 1280px;
  margin: 0 auto;
}

/* --- Menu Links --- */
#nav-menu .navbar-nav {
  display: flex !important;
  align-items: center;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#nav-menu .navbar-nav li a {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  font-size: 1rem;
  color: #2F4C7A !important;
  text-decoration: none;
  padding: 8px 0;
  border-bottom: 2px solid transparent; /* reserve space for underline */
  transition: color 0.25s ease, border-color 0.25s ease;
}

#nav-menu .navbar-nav li a:hover {
  color: #B25E3B;
  border-bottom-color: #B25E3B; /* only change color, not size */
}

/* --- Toolbar: Language + Search --- */
.toolbar-group {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 36px;
}

/* Language switcher */
.lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
  height: 34px;
}
.lang-switcher .btn-lang {
  border: 1px solid #ccd1da;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  color: #2F4C7A;
  font-size: 0.95rem;
  padding: 4px 10px;
  border-radius: 3px;
  height: 34px;
  cursor: pointer;
}
.lang-switcher .btn-lang img {
  width: 22px;
  height: 15px;
  border-radius: 2px;
}
.lang-switcher .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 2px;
  min-width: 90px;
  border: 1px solid #d3d6db;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border-radius: 4px;
  background: #fff;
  z-index: 1050;
}
.lang-switcher .dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.9rem;
  color: #2F4C7A !important;
  text-decoration: none;
}
.lang-switcher .dropdown-menu a:hover {
  background: #f3f5f9;
}
/* Smaller flags only in dropdown */
.lang-switcher .dropdown-menu img {
  width: 22px;
  height: 15px;
  border-radius: 2px;
  margin-right: 4px; /* aligns text nicely with flag */
}

/* Search box */
.menu-search-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 34px;
}
.menu-search-wrapper form {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}
.menu-search-wrapper input[type="text"] {
  height: 34px;
  width: 200px;
  border: 1px solid #ccd1da;
  border-radius: 3px;
  padding-left: 30px;
  font-size: 0.9rem;
  background: #fff url('../images/icons/search.svg') no-repeat 8px center;
  background-size: 14px;
  transition: all 0.3s ease;
}
.menu-search-wrapper input[type="text"]:focus {
  border-color: #2F4C7A;
  box-shadow: 0 0 4px rgba(47,76,122,0.15);
  outline: none;
}

/* --- Responsive --- */
@media (max-width: 992px) {
  .logo-row .container,
  .site_header .container {
    flex-direction: column;
    align-items: center;
  }
  #nav-menu .navbar-nav {
    flex-direction: column;
    gap: 12px;
  }
  .toolbar-group {
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
  }
  .menu-search-wrapper input[type="text"] {
    width: 100%;
  }
}

/* === FINAL FIX FOR MENU VISIBILITY AND FONT === */
.navbar-default .navbar-nav > li > a,
#nav-menu .navbar-nav li a,
.site_header .nav > li > a,
.site_header .main-menu a {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 500 !important;
  font-size: 1rem !important;
  color: #2F4C7A !important;
  text-shadow: none !important;
  text-transform:uppercase;
  background: transparent !important;
  line-height: 1.3;
}

.navbar-default .navbar-nav > li > a:hover,
#nav-menu .navbar-nav li a:hover,
.site_header .nav > li > a:hover,
.site_header .main-menu a:hover {
  color: #B25E3B !important;
  text-decoration: none !important;
}

/* Force visible color for focus/visited states */
#nav-menu .navbar-nav li a:visited,
#nav-menu .navbar-nav li a:focus {
  color: #2F4C7A !important;
}

/* Also force the font globally in header (for fallback consistency) */
.site_header,
.site_header a,
.lang-switcher,
.menu-search-wrapper {
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif !important;
  font-size: 1rem !important;
  color: #2F4C7A !important;
}

/* ==========================================================
   MOBILE HEADER VISIBILITY + POLISHED LAYOUT
   ========================================================== */

/* Hide mobile by default */
.af-mobile {
  display: none;
}

/* Desktop shown by default */
.af-desktop {
  display: block;
}

/* ----- MOBILE VIEW ----- */
@media (max-width: 992px) {
  /* Show only mobile version */
  .af-mobile {
    display: block !important;
    background: #ffffff;
    border-bottom: 1px solid #e3e6eb;
    visibility: visible !important;
  }

  /* Hide desktop version completely */
  .af-desktop {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  /* === MOBILE TOP ROW === */
  .mobile-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid #eaecef;
    background: #fff;
  }

  /* Language switcher (mobile) */
  .lang-switcher--mobile .btn-lang {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid #ccd1da;
    background: #fff;
    border-radius: 4px;
    padding: 4px 10px;
    height: 34px;
  }
  .lang-switcher--mobile .btn-lang img,
  .lang-switcher--mobile .dropdown-menu img {
    width: 18px !important;
    height: 12px !important;
    border-radius: 2px;
  }

  /* Dropdown alignment */
  .lang-switcher--mobile .dropdown-menu {
    min-width: 90px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  }

  /* Hamburger button */
  .hamburger-btn {
    border: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
  }
  .hamburger-line {
    width: 22px;
    height: 2px;
    background: #2F4C7A;
    transition: all 0.3s ease;
  }
  .hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translateY(6px);
  }
  .hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
  }
  .hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translateY(-6px);
  }

  /* === LOGO ROW === */
  .mobile-logo-row {
    text-align: center;
    background: #fff;
    padding: 16px 0 10px;
    border-bottom: 1px solid #eaecef;
  }
  .institution-logo-mobile {
    max-height: 80px;
    height: auto;
    width: auto;
  }

 /* --- Mobile search box (icon inside input) --- */
.mobile-search-row {
  background: #fff;
  padding: 10px 20px 12px; /* space on left/right */
  border-bottom: 1px solid #eaecef;
  position: relative; /* <— important for icon alignment */
}

.mobile-search-row form {
  position: relative; /* <— makes icon position inside input */
  width: 100%;
}

.mobile-search-row input[type="text"] {
  width: 100%;
  height: 38px;
  border: 1px solid #ccd1da;
  border-radius: 4px;
  padding: 0 40px 0 16px; /* right padding for icon */
  font-size: 0.95rem;
  background-color: #fff;
  box-sizing: border-box;
}

/* The magnifying glass button (now inside input) */
.mobile-search-row button,
.mobile-search-row input[type="submit"] {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: 0;
}

.mobile-search-row button svg,
.mobile-search-row button i {
  font-size: 17px;
  color: #2F4C7A;
  opacity: 0.8;
}

 /* === COLLAPSIBLE MENU === */
.mobile-menu-dropdown {
  display: none;
  position: absolute;              /* ⬅ ensures it sits directly below the top bar */
  top: 58px;                       /* ⬅ adjust this to match your header height */
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #dfe3e8;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  z-index: 999;
  animation: slideDown 0.25s ease;
}

/* when open */
.mobile-menu-dropdown.open {
  display: block;
  padding: 10px 22px;
  max-height: 70vh;
  overflow-y: auto;
}

/* slide-down animation */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* list structure */
.mobile-menu-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* individual menu links */
.mobile-menu-dropdown li a {
  display: block;
  color: #2F4C7A !important;
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  font-size: 0.94rem;
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 1px solid rgba(47, 76, 122, 0.08); /* fine divider line */
  transition: all 0.2s ease;
}

/* hover & active states */
.mobile-menu-dropdown li a:hover {
  color: #B25E3B !important;
  background-color: rgba(47, 76, 122, 0.03);
}

.mobile-menu-dropdown li:last-child a {
  border-bottom: none;
}

/* nested submenus (like “Rreth nesh”) */
.mobile-menu-dropdown li ul {
  margin-top: 4px;
  padding-left: 16px;
  border-left: 2px solid #e5e9ef;
}

.mobile-menu-dropdown li ul li a {
  font-size: 0.9rem;
  padding: 8px 0;
  color: #43587b !important;
}

/* touch-friendly active effect */
.mobile-menu-dropdown li a:active {
  background-color: #f9fafc;
}

/* space below search */
.mobile-search-row {
  margin-bottom: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid #eaecef;
}