/* =================== Global Styles =================== */
:root {
  --color-primary: #6c63ff;
  --color-success: #00bf8e;
  --color-hover: #ff9800;
  --color-warning: #f7c94b;
  --color-danger: #f75842;
  --color-danger-variant: rgba(247, 88, 66, 0.4);
  --color-white: #fff;
  --color-light: rgba(255, 255, 255, 0.7);
  --color-black: #000;
  --color-bg: #1f2641;
  --color-bg1: #2e3267;
  --color-bg2: #424890;

  --container-width-lg: 80%;
  --container-width-md: 90%;
  --container-width-sm: 94%;

  --transition: all400ms ease;
}

/* -------------------------- Header styling -------------------------- */
.header-topbar {
  gap: 12px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  justify-content: space-between;
  /* background: #1a1b2b; */
  background: linear-gradient(to right, #c0392b, #f39c12);

  color: var(--color-white);
  padding: 10px;
  margin-bottom: 10px;
  height: 110px;
  position: relative;
}
.logo-horizontal,
.logo-vertical {
  display: flex;
  align-items: center;
  height: 60px;
}

.logo-horizontal a,
.logo-vertical a {
  display: inline-flex;
  align-items: center;
}
.logo-horizontal img,
.logo-vertical img {
  cursor: pointer;
}

.logo-horizontal img,
.logo-vertical img {
  height: 60px;
  width: auto;
}
.logo-vertical {
  display: none;
}
.header-search {
  position: relative;
  max-width: 320px;
  width: 100%;
  margin-left: auto;         /* push to the far right */
  margin-right: 20px; /* give space from edge */
  grid-column: 3;  /* NEW: place in rightmost grid column */
  justify-self: end;         /* NEW: hug the right edge within that column */
  align-self: center;    /* vertical centering */
}
/* Search input styling (moved from inline) */
.header-search #search-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box; /* ensures padding doesn’t cut width */
}

/* Suggestions dropdown (moved from inline) */
.header-search #search-suggest {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 42px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  z-index: 1000;
  max-height: 320px;
  overflow: auto;
}

/* Hide search on mobile */
@media (max-width: 900px) {
  .header-search {
    display: none;
  }
}

@media (max-width: 1200px) {
  .laptop-title h1 { font-size: 2rem; }
  .laptop-title h2 { font-size: 1.1rem; }
}
@media (max-width: 1024px) {
  .laptop-title h1 { font-size: 1.8rem; }
  .laptop-title h2 { font-size: 1rem; }
}
.header-search { max-width: 550px; } /* 520px is also fine – purely taste */


.header-topbar-center {
  flex: 1; 
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}
.laptop-title {
  display: block;
}
.laptop-title h1 {
  padding: 0;
  margin: 0;
  margin-top: 10px;
  font-size: 2.2rem;
}
.laptop-title h2 {
  padding: 0;
  margin: 10px;
  margin-bottom: 20px;
}

.mobile-title {
  display: none;
}


/* -------------------------- Navbar styles -------------------------- */

.navbar {
  background-color: var(--color-bg2);
  width: 100%;
  font-family: Arial, Helvetica, sans-serif;
  position: relative;
  z-index: 110;
}

.nav_container {
  display: flex;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.navbar a,
.nav-dropdown .dropbtn {
  color: var(--color-white);
  padding: 14px 18px;
  text-decoration: none;
  font-size: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 500;
}

.navbar a:hover,
.nav-dropdown .dropbtn:hover,
.nav-dropdown .dropbtn:focus {
  background-color: var(--color-white);
  color: var(--color-black);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-content {
  display: none;
  position: absolute;
  background-color: #fff;
  min-width: 180px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  z-index: 10;
  top: 100%;
  left: 0;
  border-radius: 0 0 6px 6px;
  overflow: hidden;
}

.nav-dropdown-content a {
  color: var(--color-black);
  padding: 12px 18px;
  text-decoration: none;
  display: block;
  font-size: 0.98rem;
  transition: var(--transition);
}

.nav-dropdown-content a:hover {
  background-color: #f1f1f1;
  /* color: var(--color-primary); */
}

.show {
  display: block;
}

.sticky {
  position: fixed;
  top: 0;
  width: 100%;
  border-bottom: 1px solid white;
}

/* Hamburger icon (mobile) */
.icon {
  display: none;
  font-size: 1.5em;
  margin-left: auto;
  cursor: pointer;
}

/* Hamburger icon below topbar for mobile */
.mobile-hamburger {
  display: none;
}

@media (max-width: 900px) {
  /* Hamburger icon style */
  .mobile-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem auto;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 8px;
    color: #000;
    font-size: 2rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    position: absolute;
    right: 10px;
    top: 80px;
    z-index: 120;
  }
  .mobile-hamburger:hover,
  .mobile-hamburger:focus,
  .mobile-hamburger.active {
    background: var(--color-bg2);
    color: #fff;
    border-color: var(--color-bg2);
  }

  /* Hide original hamburger inside nav */
  .navbar .icon {
    display: none !important;
  }

  /* Navbar (menu) hidden by default on mobile */
  .nav_container {
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-bg2);
    width: 100%;
    padding: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  }
  .nav_container.responsive {
    display: block;
    animation: fadeInMenu 0.25s;
    margin: 0 0 10px 0;
    padding: 20px 0 20px 0;
  }
  @keyframes fadeInMenu {
    from {
      opacity: 0;
      transform: translateY(-3px);
      transition: var(--transition);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .navbar a,
  .nav-dropdown .dropbtn {
    width: 100%;
    text-align: left;
    padding: 17px 30px;
    margin: 0;
    /* border-top: 1px solid #eee; */
    border-radius: 0;
    background: none;
  }
  .nav-dropdown-content {
    position: static;
    margin: 0;
    min-width: 100%;
    box-shadow: none;
    border-radius: 0;
    background: #f9f9f9;
  }
  .nav-dropdown-content a {
    padding: 9px 0 9px 30px;
    margin: 0;
    background: #f9f9f9;
  }
  /* Dropdowns hidden by default on mobile */
  .nav-dropdown-content {
    display: none;
  }

  /* 1. Full-width white bg for nav-items */
  .nav-items {
    background: #fff;
    width: 100%;
    /* margin-left: calc(-1 * (100vw - 100%) / 2); */
    color: var(--color-black);
    border-radius: 0;
    box-sizing: border-box;
    margin: 10px 0 0 0;
  }
  .nav-items:hover,
  .nav-items:focus {
    background: var(--color-hover);
    color: var(--color-black);
  }

  /* 2. Uniform margin for all nav items */
  .nav_container > * {
    margin: 0px 0;
  }

  /* 3. Remove gap between open dropdown button and its menu */
  .nav-dropdown.open > .dropbtn {
    margin-bottom: 0;
  }
  .nav-dropdown.open .nav-dropdown-content {
    display: block;
    margin-top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
  }
}

/* Always show nav in desktop */
@media (min-width: 901px) {
  .mobile-hamburger {
    display: none !important;
  }
  .nav_container {
    display: flex !important;
  }
}

/* -------------------------- Responsive styles -------------------------- */
@media (max-width: 768px) {
  .logo-horizontal {
    display: none;
  }
  .logo-vertical {
    display: block;
  }
  /* .header-topbar-center {
    justify-content: center;
    margin-right: 70px;
  } */
  .laptop-title {
    display: none;
  }
  .mobile-title {
    display: block;
    font-size: 0.7em;
    font-weight: 500;
  }
  .header-topbar {
    height: 70px;
    padding: 0 12px;
  }
  /* .header-topbar-right {
    position: absolute;
    right: 16px;
    bottom: 10px;
    top: auto;
    min-width: unset;
  } */
}

/* === Search UX polish === */
.header-search #search-input:focus {
  outline: none;
  border-color: var(--color-bg2);
  box-shadow: 0 0 0 3px rgba(66,72,144,.15);
}

/* dropdown animation */
#search-suggest {
  transform-origin: top;
  opacity: 0;
  transform: translateY(-4px) scale(.98);
  transition: opacity .15s ease, transform .15s ease;
}
#search-suggest.show {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* grouped sections */
.srch-group {
  padding: 6px 8px 4px;
  border-top: 1px solid #f3f3f3;
}
.srch-group:first-child { border-top: 0; }
.srch-group__title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #777;
  text-transform: uppercase;
  margin: 6px 10px 4px;
}

/* rows */
.srch-suggest-row {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  text-decoration: none;
  color: #222;
  border-radius: 8px;
  margin: 2px 6px;
}
.srch-suggest-row:hover,
.srch-suggest-row[aria-selected="true"] {
  background: rgba(0,0,0,.04);
}

/* badges */
.srch-badge {
  font-size: 11px;
  line-height: 1;
  padding: 6px 8px;
  border-radius: 999px;
  background: #eee;
  align-self: flex-start;
  white-space: nowrap;
}
.srch-badge--faculty   { background: rgba(108,99,255,.12); color: #444; }
.srch-badge--staff     { background: rgba(0,191,142,.14);  color: #244; }
.srch-badge--student   { background: rgba(247,88,66,.12);  color: #442; }
.srch-badge--link      { background: rgba(66,133,244,.12); color: #234; }
.srch-badge--section   { background: rgba(66,66,66,.08);   color: #333; }
.srch-badge--announce  { background: rgba(255,152,0,.14);  color: #432; }
.srch-badge--spotlight { background: rgba(246,229,141,.28); color:#333; }
.srch-badge--page      { background: rgba(0,0,0,.06);      color: #333; }

/* tiny “jump” pill for anchored results */
.srch-pill {
  display: inline-block;
  font-size: 11px;
  border: 1px solid #ddd;
  padding: 3px 6px;
  border-radius: 999px;
  margin-left: 6px;
}

/* footer action */
.srch-footer {
  border-top: 1px solid #eee;
  padding: 8px 12px;
  text-align: right;
  font-size: 12px;
  background: #fafafa;
}
.srch-footer a { text-decoration: none; }

/* shimmer skeleton (also used on search.html) */
.skel {
  background: linear-gradient(90deg, #f4f4f4 25%, #ececec 37%, #f4f4f4 63%);
  background-size: 400% 100%;
  animation: skel 1.2s ease infinite;
}
@keyframes skel {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
/* ---------- Search UI / glassy animated styles (append to your CSS) ---------- */

/* ---------- Search UI / glassy animated styles (mic removed) ---------- */

/* Container */
.fancy-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 520px;
  width: 100%;
  margin-left: auto;
  margin-right: 50px;
  padding: 6px 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  backdrop-filter: blur(8px) saturate(120%);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 8px 28px rgba(11,14,40,0.10);
  transition: transform .28s cubic-bezier(.2,.9,.3,1), box-shadow .28s ease;
  z-index: 120;
}

/* Lift on focus */
.fancy-search:focus-within {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(66,72,144,0.14);
  border-color: rgba(108,99,255,0.14);
}

/* Search button */
.fancy-search .search-btn {
  display:flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  border-radius:10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: none;
  color: #fff;
  cursor: default;
  transition: transform .22s ease, background .22s ease, box-shadow .22s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.fancy-search .search-btn:hover { transform: rotate(-12deg) scale(1.05); background: rgba(255,255,255,0.06); }

/* Input */
.fancy-search input#search-input {
  flex: 1 1 auto;
  min-width: 160px;
  border: none;
  background: transparent;
  color: #fff;
  padding: 12px 10px;
  font-size: 0.98rem;
  border-radius: 10px;
  outline: none;
  transition: width .36s cubic-bezier(.2,.9,.3,1), box-shadow .18s;
}

/* Expand input on focus */
.fancy-search:focus-within input#search-input { width: 260px; }

/* Placeholder */
.fancy-search input#search-input::placeholder { color: rgba(255,255,255,0.78); font-weight:500; }

/* typing class: keep caret visible */
.fancy-search input.typing { caret-color: #fff; }

/* Suggestion dropdown */
#search-suggest {
  display: none;
  position: absolute;
  right: 0;
  left: 0;
  top: calc(100% + 12px);
  background: #fff;
  color: #222;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(16,24,40,0.12);
  padding: 8px;
  z-index: 130;
  max-height: 380px;
  overflow: auto;
  opacity: 0;
  transform-origin: top right;
  transform: translateY(-8px) scale(.995);
  transition: opacity .16s ease, transform .18s ease;
}

/* visible state */
#search-suggest.show { display:block; opacity:1; transform: translateY(0) scale(1); }

/* groups */
.srch-group { padding: 6px 6px 4px; border-top: 1px solid #f3f3f3; }
.srch-group:first-child { border-top: 0; }
.srch-group__title { font-size: 11px; font-weight: 700; color: #777; text-transform: uppercase; margin: 6px 8px 6px; }

/* rows */
.srch-suggest-row {
  display:flex;
  gap:12px;
  align-items:center;
  padding:10px 12px;
  border-radius:8px;
  text-decoration:none;
  color:#222;
  margin: 2px 6px;
  transition: background .14s ease, transform .12s ease;
}
.srch-suggest-row:hover,
.srch-suggest-row[aria-selected="true"] {
  background: rgba(0,0,0,0.04);
  transform: translateX(3px);
}

/* badge */
.srch-badge { font-size:11px; padding:6px 8px; border-radius:999px; white-space:nowrap; align-self:flex-start; }
.srch-badge--faculty   { background: rgba(108,99,255,0.12); color:#3c2d7a; }
.srch-badge--staff     { background: rgba(0,191,142,0.12);  color:#0b563f; }
.srch-badge--student   { background: rgba(247,88,66,0.12);  color:#6b2e2e; }
.srch-badge--announce  { background: rgba(255,152,0,0.14);  color:#663d00; }
.srch-badge--page      { background: rgba(0,0,0,0.06);      color:#333; }

/* pill */
.srch-pill { font-size:11px; border:1px solid #eee; padding:3px 7px; border-radius:999px; margin-left:8px; }

/* footer link */
.srch-footer { border-top:1px solid #eee; padding:8px 12px; text-align:right; font-size:12px; background:#fafafa; border-radius:0 0 12px 12px; }

/* Small-screen: hide fancy search (keep your existing rule) */
@media (max-width:900px) {
  .header-search { display:none; }
}
