



/* =========================================================
   4. NAVBAR CORE
========================================================= */

/* ===== Simple Navbar ===== */

.navbar {
  position: fixed;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 1000;

  /* ADD THIS */
  overflow: visible;

}


.navbar {
  width: 100%;
}

/* Centered container & items inside navbar */
/* INACTIVE NOW

/*
.nav {
  max-width: 1200px;   // SAME as your .container 
  margin: 0 auto;      // CENTER it 
  padding: 12px 18px;  // match container padding 
}

*/

@supports (backdrop-filter: blur(6px)) {

.navbar {
  position: fixed;
  top: 0;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px); /* Safari */
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  }
}


.nav {
  padding: 12px 16px;
}


/* Left & Right control containers */
.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  min-width: 40px;
}


.logo {
  font-size: 1.2rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text);
}



/* =========================================================
   5. NAV LINKS
========================================================= */


.links {
  display: flex;
  gap: 18px;
}

.links a {
  position: relative;
  text-decoration: none;
  color: var(--nav-text);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: color 0.2s ease;
}

.links a:hover {
  color: var(--text);
}


.links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--main-bg-color);
  transition: width 0.25s ease;
}

.links a:hover::after {
  width: 100%;
}



/* ================= HAMBURGER ================= */
.hamburger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;

  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;

  transition: transform 0.15s ease;
}

.hamburger span {
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.25s ease;
}

.hamburger:active {
  transform: scale(0.92);
}

/* morph animation */
.hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger.open span:nth-child(2) {
  opacity: 0;
}
.hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.theme-toggle {
  background: var(--card-bg);
  border: 1px solid var(--theme-toggle-border);
  border-radius: 50%;
  z-index: 1200;
  cursor: pointer;
  font-size: 1.1rem;
  margin-left: 12px;
  padding: 8px 10px;
  color: var(--text);
}



/* Smooth transitions */
.links a,
.drop-title,
.drop-menu a {
  transition: color 0.2s ease, background-color 0.2s ease;
}



/* =========================================================
   6. DROPDOWNS (DESKTOP FLOATING)
========================================================= */

/* ===== Dropdown (Desktop) ===== */

.dropdown {
  position: relative;
}

.drop-title {
  cursor: pointer;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--nav-text);
  user-select: none;
}

.drop-menu {
  display: none;            /* IMPORTANT */
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 160px;
  flex-direction: column;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.drop-menu a {
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text);
  font-size: var(--text-sm);
  transition: background-color 0.2s ease;
}

.drop-menu a:hover {
  background: var(--bg-soft);
}

/* Mobile click open */
.dropdown.open .drop-menu {
  display: flex;
}


.caret {
  display: inline-block;
  transition: transform 0.25s ease;
}

.dropdown:hover .caret {
  transform: rotate(180deg);
}


/* Desktop hover */
@media (min-width: 769px) {
  .dropdown:hover .drop-menu {
    display: flex;
  }
}

/* =========================================================
   7. DESKTOP NAVBAR LAYOUT (LOCKED)
========================================================= */

/* ===== DESKTOP NAVBAR – FINAL LOCK ===== */
@media (min-width: 769px) {
  .nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }

  /* Left */
  .nav-left {
    justify-self: start;
    display: flex;
  }

  /* Center */
  .links {
    display: flex !important;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: static;
  }

  /* Right */
  .logo {
    justify-self: end;
  }

  /* Desktop cleanup */
  .menu-toggle,
  .nav-right {
    display: none;
  }
}




/* ===============================
   NAVBAR SEARCH (LIGHTWEIGHT)
================================ */

.nav-search {
  position: relative;
  margin-left: 10px;
}

.search-icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 42px;
  height: 42px;

  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--theme-toggle-border);
  border-radius: 50%;

  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);

  transition: all 0.2s ease;
}

.search-icon:hover {
  background: var(--bg-soft);
  transform: scale(1.05);
}

.search-icon:active {
  transform: scale(0.95);
}


#navSearchInput {
  position: absolute;
  left: 0;
  top: 120%;
  width: 180px;

  padding: 8px 10px;
  font-size: var(--text-sm);

  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;

  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: all 0.2s ease;

  z-index: 1500;
}

/* Placeholder */
.nav-search input::placeholder {
  color: var(--text);
}



.nav-search.active #navSearchInput {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}





/* --- Search Text Fix -- */
.search-icon {
  fwidth: 38px;
  height: 38px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);

  cursor: pointer;
  font-size: 16px;
  color: var(--text);

  transition: all 0.2s ease;
  letter-spacing: 0.4px;
}



#searchTitle {
  margin-bottom: 6px;
}

#resultCount {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

