
/* THEME VARIABLES */
body {
  --bg: #0B1020;
  --text: #ffffff;
  background-color: var(--bg);
  color: var(--text);
}

body.light {
  --bg: #ffffff;
  --text: #222222;
}

/* NAVBAR WRAPPER */
.nav {
  position: sticky;
  top: 0;
  z-index: 999;
  width: 100%;

  /* ONLY ONE padding definition */
  padding: 8px 16px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;

  /* glossy / modern */
  background: linear-gradient(135deg, #1E4596, #128CCC);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);

  min-height: 80px;
  box-sizing: border-box;    /* <--- IMPORTANT */
}

.nav * {
  box-sizing: border-box;
}

/* LEFT: LOGO */
.nav-left {
  display: flex;
  align-items: center;
  gap: 16px; /* space between logo and toggle */
}

.logo {
  width: 200px;
  height: auto;
}


@media (max-width: 768px) {
  .logo {
    width: 54px;
  }
}

@media (min-width: 1024px) {
  .logo {
    width: 78px;
  }
}


/* CENTER: DESKTOP LINKS */
.nav-center {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-center a {
  font-family: "Sarpanch", system-ui, sans-serif;
  font-size: 17px;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: #e6ecff;
  transition: 0.2s ease;
}

.nav-center a:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

/* RIGHT: TOGGLE + HAMBURGER */
.nav-right {
  display: flex;
  align-items: center;
  gap: 18px;
}


body.light .nav {
  background: #ffffff;
  color: var(--blue-dark);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

body.light .nav-center a {
  color: var(--blue-dark);
}

body.light .hamburger span {
  background: var(--blue-dark);
}

/* USER BLOCK */
.nav-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-left: 8px;
}

body.light .nav-user-avatar {
  background: var(--blue-dark);
  color: #fff;
}
.nav-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}



/* HAMBURGER */
.hamburger {
  width: 28px;
  height: 20px;
  display: none;               /* hidden by default (desktop) */
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.hamburger span {
  height: 3px;
  border-radius: 999px;
  background: #ffffff;
  width: 100%;
}

/* MOBILE MENU DROPDOWN */
.mobile-menu {
  position: absolute;
  top: 64px;
  left: 0;
  width: 100%;
  background: #1E4596;
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  padding: 18px 22px;
}

.mobile-menu a {
  color: #f5f7ff;
  text-decoration: none;
  font-family: "Sarpanch", system-ui, sans-serif;
  font-size: 16px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.mobile-menu a:last-child {
  border-bottom: none;
}

/* RESPONSIVE BEHAVIOUR */
.desktop-only {
  display: flex;
}

.mobile-only {
  display: none;
}

@media (max-width: 768px) {
  .nav {
    padding: 10px 16px;
  }

  .desktop-only {
    display: none;       /* hide nav links on mobile */
  }

  .mobile-only {
    display: flex;       /* show hamburger on mobile */
  }


}

.toggle-wrapper {
  display: flex;
  align-items: center;
  margin-right: 8px; /* spacing before avatar */
  flex-shrink: 0;
}

/* Removed mobile transform scaling for `.toggle-wrapper` per dashboard design */

.mobile-menu {
  position: absolute;
  top: 64px;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 22px 26px;

  /* GLASS LAYER */
  background: linear-gradient(
    180deg,
    rgba(20, 40, 95, 0.70) 0%,   /* slightly darker top */
    rgba(30, 69, 150, 0.65) 40%, /* mid glass */
    rgba(18, 140, 204, 0.55) 100% /* lighter bottom fade */
  );

  /* BLUR */
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);

  /* GLOW + DEPTH */
  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.45),
    0 0 18px rgba(18, 140, 204, 0.35); /* subtle blue glow */

  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
  border-top: 1px solid rgba(255, 255, 255, 0.10);

  /* Smooth animation */
  transition:
    background 0.35s ease,
    backdrop-filter 0.35s ease,
    box-shadow 0.35s ease,
    opacity 0.35s ease;

    animation: slideDown 0.35s ease forwards;
transform-origin: top;
opacity: 0;

border-radius: 0 0 18px 18px;

box-shadow:
    0 8px 20px rgba(0,0,0,0.45),
    0 0 28px rgba(18, 140, 204, 0.45); /* stronger brand glow */
}

.mobile-menu a {
  border-bottom: 1px solid rgba(255,255,255,0.12);
  position: relative;
}

.mobile-menu a::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(18,140,204,0.4), rgba(255,255,255,0.1));
}

@keyframes slideDown {
  0% {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

body.light .mobile-menu {
  background: rgba(255, 255, 255, 0.75);

  backdrop-filter: blur(22px) saturate(200%);
  -webkit-backdrop-filter: blur(22px) saturate(200%);

  box-shadow:
    0 10px 20px rgba(0,0,0,0.10),
    0 0 15px rgba(30, 69, 150, 0.15); /* subtle blue glow */

  border-bottom: 1px solid rgba(0,0,0,0.08);
  border-top: 1px solid rgba(0,0,0,0.05);
   box-shadow:
    0 8px 16px rgba(0,0,0,0.12),
    0 0 20px rgba(30, 69, 150, 0.25); /* soft blue glow */
}

body.light .mobile-menu a {
  color: var(--blue-dark);
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

body.light .mobile-menu a::after {
  background: linear-gradient(90deg, rgba(30,69,150,0.4), rgba(0,0,0,0.1));
}

.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(3px);
  background: rgba(0,0,0,0.4);
  z-index: 998;   /* below mobile menu, above page */
  opacity: 0;
  animation: overlayFade 0.35s forwards;
}

@keyframes overlayFade {
  from { opacity: 0 }
  to   { opacity: 1 }
}

body.light .menu-overlay {
  background: rgba(0,0,0,0.25);
}


/* --- MAKE THE THEME TOGGLE VISIBLE IN NAVBAR --- */
.nav .tdnn {
  box-shadow:
    inset 0 0 0 0.35em rgba(255,255,255,0.35),
    0 0.4em 0.8em rgba(0,0,0,0.35);
    max-width: none;
}

/* optional but recommended: clearer moon on dark bg */
.nav .moon {
  background: #2f284f;
}


.nav-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  color: #fff;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
}

.nav-user {
  position: relative;
  cursor: pointer;
}

/* Dropdown container */
.nav-user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;

  min-width: 180px;
  padding: 8px;

  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.4);

  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s ease;

  z-index: 1000;
}

/* Active state */
.nav-user.open .nav-user-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown items */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;

  padding: 10px 12px;
  border-radius: 8px;

  text-decoration: none;
  color: #111;
  font-size: 14px;
  font-weight: 500;

  transition: background 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.dropdown-item.logout {
  color: #b42318;
}

.nav-user-trigger::after {
  content: "▾";
  margin-left: 8px;
  transition: transform 0.2s ease;
}

.nav-user.open .nav-user-trigger::after {
  transform: rotate(180deg);
}

.nav-user-trigger {
  outline: none;
}
