/* --- Navigation CSS --- */

/* Ensure these variables exist in your :root, or keep them here */
:root {
  --color-soulBlue: #0692d4;
  --color-soulTeal: #00bdd6;
  --color-slate-50: #f8fafc;
  --color-slate-200: #e2e8f0;
  --color-slate-500: #64748b;
  --color-slate-600: #475569;
  --color-soulBlue-10: rgba(6, 146, 212, 0.1);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-xl:
    0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000; /* High z-index to stay on top */
  transition: all 0.3s ease;
  padding: 1.25rem 0;
  background: transparent;
}

.navbar.glass-nav {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0.75rem 0;
  box-shadow: var(--shadow-sm);
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo Styles */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}
.brand-icon {
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--color-soulBlue);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #0f172a;
}

/* Links Container */
.nav-links {
  display: none; /* Hidden on mobile by default */
  gap: 2rem;
  font-weight: 500;
  color: var(--color-slate-600);
  align-items: center;
}

@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

.nav-links > a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
}
.nav-links > a:hover,
.nav-links > a.active {
  color: var(--color-soulBlue);
}

/* --- Dropdown Logic --- */
.nav-item-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 1rem 0; /* Adds hover area buffer */
  cursor: pointer;
}

.nav-item-dropdown > a {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--color-slate-600);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-item-dropdown:hover > a,
.nav-item-dropdown > a.active {
  color: var(--color-soulBlue);
}

/* Main Dropdown Menu */
.dropdown-menu {
  position: absolute;
  top: 100%; /* Position below parent */
  left: -1rem;
  background: white;
  border: 1px solid var(--color-slate-200);
  border-radius: 1rem;
  box-shadow: var(--shadow-xl);
  min-width: 18rem;
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 100;
  margin-top: -0.5rem; /* Pull up slightly to overlap padding buffer */
}

.nav-item-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Dropdown Items */
.dropdown-item {
  position: relative;
  display: flex; /* Establish flex context */
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  color: var(--color-slate-600);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
}

.dropdown-item:hover {
  background-color: var(--color-slate-50);
  color: var(--color-soulBlue);
}

/* The clickable link covering the item */
.dropdown-item > a.item-link {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.dropdown-item-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  pointer-events: none; /* Let clicks pass through to the anchor or parent */
}

/* --- Nested Submenu --- */
.submenu {
  position: absolute;
  top: 0;
  left: 100%; /* Push to the right */
  margin-left: 0.5rem; /* Spacing */
  background: white;
  border: 1px solid var(--color-slate-200);
  border-radius: 1rem;
  box-shadow: var(--shadow-xl);
  min-width: 16rem;
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 60vh; /* Prevent overflow on small screens */
  overflow-y: auto;
  z-index: 101;
}

/* Show submenu on hover of parent item */
.dropdown-item:hover .submenu {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.submenu-item {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  color: var(--color-slate-500);
  border-radius: 0.5rem;
  transition: all 0.2s;
  cursor: default; /* Sub-items are text only per request, or change to <a> if linking */
  text-decoration: none;
}

.submenu-item:hover {
  background-color: var(--color-slate-50);
  color: var(--color-soulBlue);
}

/* Button */
.btn-nav {
  background-color: var(--color-soulBlue);
  color: white;
  padding: 0.625rem 1.5rem;
  border-radius: 9999px;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: 0 10px 15px -3px rgba(6, 146, 212, 0.2);
}
.btn-nav:hover {
  background-color: var(--color-soulTeal);
  transform: scale(1.05);
}
