@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@300;400;500;600&display=swap');

/* Navbar Container */
/* Navbar Placeholder (Container) - Handles Sticky Positioning */
#navbar-placeholder {
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* Navbar Container */
/* Navbar Container - Floating Glass Design */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 30px;
  background: var(--navbar-bg);
  /* Use semi-transparent var if available, else override below */
  background: rgba(255, 255, 255, 0.7);

  /* Floating Positioning */
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1280px;
  border-radius: 20px;

  /* Premium Glassmorphism */
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);

  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrolled state (optional - Javascript would toggle this class, keeping it simple for now as always floating) */

/* Adjusted Spacer for Fixed Nav */
#navbar-placeholder {
  height: 100px;
  /* Push content down since nav is fixed */
  background: transparent;
}

/* Logo */
.logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.logo img {
  height: 40px;
  width: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ff5722;
}

/* Nav Links */
.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-links li a {
  text-decoration: none;
  color: var(--text-muted);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: #ff5722;
}

/* Login Button */
.login-button {
  background: linear-gradient(135deg, #ff5722 0%, #ff7043 100%);
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 10px 24px;
  border-radius: 50px;
  /* Pill shape */
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 12px rgba(255, 87, 34, 0.2);
}

.login-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(255, 87, 34, 0.3);
  background: linear-gradient(135deg, #ff5722 0%, #ff7043 100%) !important;
  /* Override global hover */
}

.login-button:active {
  transform: translateY(0);
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  font-size: 1.5rem;
  /* Larger icon */
  cursor: pointer;
  color: var(--text-main);
  background: transparent !important;
  /* Force transparent to override global button */
  border: none;
  padding: 5px;
  transition: color 0.3s ease;
}

.menu-toggle:hover {
  color: var(--brand);
  background: transparent !important;
}

/* Theme Toggle */
.theme-btn {
  background: transparent !important;
  /* Ensures no global button background override */
  color: var(--text-main);
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
  padding: 0;
}

.theme-btn:hover {
  background-color: rgba(0, 0, 0, 0.05) !important;
  transform: rotate(15deg);
}

/* Dark mode overrides */
[data-theme="dark"] .navbar {
  background: rgba(18, 18, 18, 0.75);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .theme-btn {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .theme-btn:hover {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .menu-toggle {
  color: #ffffff;
}

@media (max-width: 850px) {
  [data-theme="dark"] .nav-links {
    background: #1e1e1e;
    border-bottom-color: rgba(255, 255, 255, 0.1);
  }

  [data-theme="dark"] .nav-links li a {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }

  /* Utility Icons Border Fix */
  [data-theme="dark"] #nav-notifications-link,
  [data-theme="dark"] #nav-theme-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
  }
}

/* Responsive Design */
@media (max-width: 850px) {
  .navbar {
    padding: 15px 20px;
    /* Fixed padding for mobile */
    position: relative;
    /* Ensure dropdown is relative to this */
  }

  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    color: #1a1a1a;
    background: transparent;
    border: none;
    z-index: 1001;
    position: relative;
    /* Ensure it stays in flow or absolute if needed */
  }

  .nav-links {
    position: absolute;
    top: calc(100% + 15px);
    /* Gap between navbar and menu */
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;

    border: 1px solid transparent;
    border-radius: 20px;
    /* Rounded card */
    box-shadow: none;

    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 0;
    z-index: 1000;
  }

  /* Dark mode mobile menu */
  [data-theme="dark"] .nav-links {
    background: rgba(20, 20, 20, 0.95);
  }

  [data-theme="dark"] .nav-links.show {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
  }

  /* Utility Icons Row (Notifications & Theme) */
  #nav-notifications-link,
  #nav-theme-item {
    width: 50%;
    /* Share row */
    display: flex;
    justify-content: center;
    border-bottom: none;
    /* No border for cleaner separation */
    padding: 15px 0 5px;
    /* Slight adjust */
  }

  #nav-notifications-link a {
    border-bottom: none;
    /* Remove inner border */
    padding: 0;
    width: auto;
    font-size: 1.2rem;
    /* Match theme icon size */
  }

  /* Adjust theme item specific spacing */
  #nav-theme-item {
    margin-top: 0;
    /* Reset */
  }

  .nav-links.show {
    max-height: 600px;
    /* Increased to prevent cutoff */
    padding-bottom: 20px;
    /* Add bottom spacing */
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links li a {
    display: block;
    padding: 15px 0;
    width: 100%;
    border-bottom: 1px solid #f8f9fa;
  }

  .nav-links li:last-child a {
    border-bottom: none;
  }

  .nav-links .login-button {
    margin: 20px 0;
    width: 80%;
  }
}