/* ================= HEADER / NAV ================= */
.header {
  position: sticky;
  top: 0;
  z-index: 9;
  background-color: transparent;
  transition: background-color 220ms ease;
  /* এটাতেই smooth হবে */
  will-change: background-color;
}

/* scroll হলে */
.header[data-state="scrolled"] {
  background-color: color-mix(
    in srgb,
    rgb(var(--theme)) 10%,
    rgb(var(--div-bg)) 90%
  );
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.1);
}
.menu-close-wrapper {
  display: none;
}
.navbar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.site-logo img {
  width: 120px;
  opacity: 1;
  transform: none;
  image-rendering: -webkit-optimizeQuality;
  filter: contrast(0.9) saturate(1.5);
  transition: all 0.3s ease;
  fill: green;
}

.site-logo img:hover {
  transform: scale(1.03);
  filter: contrast(1.1);
}

/* ================= DESKTOP NAV ================= */
.nav {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav li {
  position: relative;
  border-radius: 4px;
}

.nav a,
.dropdown > button {
  font-size: 15px;
  font-weight: 500;
  color: rgba(var(--text), 1);
  padding: 5px 10px;
  position: relative;
  border: 2px solid transparent !important;
}
.nav-button-label {
  font-size: 15px;
}
.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: rgba(var(--theme), 0.7);
  transition: width 0.3s ease;
}
.dropdown-menu a::after {
  content: none;
}
.nav a:hover::after {
  width: 100%;
}
.nav a:hover,
.dropdown button:hover,
.dropdown-menu a:hover {
  text-shadow:
    0 0 1px currentColor,
    0 0 0.5px currentColor;
  color: rgba(var(--theme), 1);
}
.active > a,
.dropdown.active button {
  color: rgba(var(--theme), 1) !important;
  text-shadow:
    0 0 1px currentColor,
    0 0 0.5px currentColor;
  border-bottom: 2px solid rgba(var(--theme), 0.7) !important;
  background-color: rgba(var(--theme), 0.06);
  border-radius: 8px 8px 0px 0px;
}
.nav a svg{
  margin: 0;
}
/* Dropdown desktop */
.dropdown {
  display: flex;
  align-items: center;
  gap: 0px;
  position: relative;
  transition: all 0.3s ease;
}
.dropdown:hover > button {
  text-shadow:
    0 0 1px currentColor,
    0 0 0.5px currentColor;
  color: rgba(var(--theme), 1);
  border-bottom: 2px solid rgba(var(--theme), 0.7) !important;
}

.dropdown button {
  background: none;
  border: none;
  cursor: pointer;
}
.nav-button-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.nav-button-label svg {
  width: 18px;
  height: 18px;
}
.mobile-nav-icon {
  display: none;
}
.dropdown .dd_arrow {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.25s ease;
}
.dropdown:hover .dd_arrow {
  transform: rotate(225deg) translate(-1px, -1px);
}
.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: auto;
  min-width: 250px;
  background: rgba(var(--div-bg), 0.8);
  backdrop-filter: blur(10px) saturate(100%);
  -webkit-backdrop-filter: blur(10px) saturate(100%);
  border-radius: 4px 4px 16px 16px;
  padding: 10px;
  list-style: none;
  box-shadow: 0 20px 40px rgba(var(--theme), 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: 0.3s ease;
  z-index: 999;
}
.dropdown-menu li {
  border-bottom: 1px solid var(--border);
}
.dropdown-menu li:nth-last-child(1) {
  border: none !important;
}
.dropdown-menu li a {
  font-size: 14px;
  border: none !important;
  color: rgba(var(--text), 1);
}
.user-dropdown .dropdown-menu {
  right: 0;
  left: auto;
}
.dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu a {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
}
.dropdown-menu li a::before {
  content: ">>";
  margin-right: 10px;
  display: inline-block;
  font-weight: bold;
}
.no-before li a::before {
  display: none;
}
.dropdown-menu li:hover {
  background: rgba(var(--theme), 0.1);
}
.dropdown-menu li svg {
  margin-right: 10px;
}
/* ================= HAMBURGER ================= */
.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 1px solid rgba(var(--theme), 0.16);
  border-radius: 10px;
  color: rgba(var(--text), 1);
  background: rgba(var(--div-bg), 0.7);
  cursor: pointer;
}
.menu-toggle span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.nav-label,
.mobile-menu-logo {
  display: none;
}

.navbar > .user-dropdown {
  flex: 0 0 auto;
}
.user-dropdown button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 210px;
  min-height: 42px;
  padding: 6px 10px;
  overflow: hidden;
  white-space: nowrap;
  border: 1px solid rgba(var(--theme), 0.14) !important;
  border-radius: 12px;
  background: rgba(var(--div-bg), 0.72);
  text-transform: capitalize;
  font-size: 14px;
}
.user-dropdown button img {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: 10px;
  margin-right: 4px;
  border: 1px solid rgba(var(--theme), 0.5);
  opacity: 0.9;
}
.user-dropdown button .dd_arrow {
  font-size: 9px;
  transition: transform 0.4s ease;
}

@media (max-width: 1180px) {
  .user-dropdown button {
    max-width: 170px;
  }
}

/* ================= MOBILE NAV ================= */
/* ================= MOBILE NAV (SLIDE IN FROM LEFT) ================= */
@media (max-width: 1000px) {
  .navbar {
    min-height: 64px;
  }

  .menu-toggle {
    display: inline-flex;
    color: rgba(var(--text), 1);
  }

  .menu-toggle:hover {
    border-color: rgba(var(--theme), 0.32);
    color: rgba(var(--theme), 1);
    background: rgba(var(--theme), 0.08);
  }

  .navbar > .btn,
  .navbar > .user-dropdown {
    display: none !important;
  }

  .nav {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 9999;
    display: flex;
    width: min(390px, 100%);
    height: 100dvh;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 16px;
    border-right: 1px solid rgba(var(--theme), 0.14);
    background:
      linear-gradient(135deg, rgba(var(--theme), 0.1), transparent 42%),
      rgba(var(--div-bg), 0.98);
    box-shadow: 28px 0 70px rgba(0, 0, 0, 0.18);
    transform: translateX(-105%);
    transition: transform 0.28s ease;
    overflow-y: auto;
  }

  .nav.active {
    transform: translateX(0);
  }

  .menu-close-wrapper {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(var(--text), 0.08);
  }

  .mobile-menu-logo {
    display: inline-flex;
    width: 150px;
  }

  .mobile-menu-logo img {
    width: 150px;
    opacity: 1;
  }

  .menu-close {
    display: inline-flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--text), 0.1);
    border-radius: 10px;
    color: rgba(var(--text), 0.86);
    background: rgba(var(--body-bg), 0.42);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
  }

  .menu-close:hover {
    border-color: rgba(var(--theme), 0.3);
    color: rgba(var(--theme), 1);
    background: rgba(var(--theme), 0.08);
  }

  .nav li {
    width: 100%;
    border-radius: 10px;
  }

  .nav a,
  .dropdown > button {
    display: flex;
    width: 100%;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px 10px;
    border: 1px solid rgba(var(--text), 0.075) !important;
    border-radius: 10px;
    color: rgba(var(--text), 0.84);
    background: rgba(var(--body-bg), 0.38);
    font-size: 14px;
    font-weight: 400;
    text-shadow: none;
  }
  .nav a.mobile-menu-logo {
    border: none !important;
  }
  .nav a {
    justify-content: flex-start;
  }

  .dropdown > button {
    justify-content: space-between;
  }

  .nav a svg {
    width: 18px;
    height: 18px;
  }

  .mobile-nav-icon {
    display: inline-flex;
    flex: 0 0 20px;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
  }

  .mobile-nav-icon svg,
  .nav-button-label .mobile-nav-icon svg {
    width: 18px;
    height: 18px;
    margin-right: 0;
  }

  .nav-label {
    display: inline;
  }

  .nav a::after {
    content: none;
  }

  .nav a:hover,
  .dropdown > button:hover,
  .active > a,
  .dropdown.active > button {
    border-color: rgba(var(--theme), 0.28) !important;
    color: rgba(var(--theme), 1) !important;
    background: rgba(var(--theme), 0.08);
    border-radius: 10px;
  }

  .dropdown {
    display: block;
    width: 100%;
  }

  .dropdown .dd_arrow {
    margin-left: auto;
  }

  .dropdown.open > button .dd_arrow {
    transform: rotate(225deg) translate(-1px, -1px);
  }

  .dropdown-menu {
    position: static;
    display: none;
    width: 100%;
    min-width: 100%;
    margin-top: 7px;
    padding: 8px;
    border: 1px solid rgba(var(--theme), 0.1);
    border-radius: 12px;
    background: rgba(var(--theme), 0.035);
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .dropdown.open .dropdown-menu {
    display: grid;
    gap: 6px;
  }

  .dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .dropdown-menu li {
    border-bottom: 0;
  }

  .dropdown-menu a {
    min-height: 40px;
    padding: 10px 12px 8px;
    border: 0 !important;
    background: transparent;
    font-size: 13px;
  }

  .dropdown-menu li a::before {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 10px;
    border-radius: 999px;
    background: rgba(var(--theme), 0.65);
  }

  .no-before li a::before {
    display: none;
  }

  .dropdown-menu li:hover {
    background: transparent;
  }
}

body.menu-open {
  overflow: hidden;
}
