/* ==============================
   ROOT VARIABLES
============================== */
:root {
  --nav-bg: rgba(20, 22, 28, 0.78);
  --nav-bg-solid: rgba(15, 17, 22, 0.96);

  --nav-border: rgba(255, 255, 255, 0.08);

  --nav-text: #f5f5f7;
  --nav-text-muted: rgba(255,255,255,0.78);

  --nav-accent: #4CAF50;
  --nav-hover-bg: rgba(255,255,255,0.06);

  --dropdown-bg: rgba(255,255,255,0.98);
  --dropdown-text: #1d1d1f;

  --shadow-lg: 0 12px 40px rgba(0,0,0,0.18);

  --transition: 0.28s ease;
}

/* ==============================
   HEADER
============================== */
.header {
  position: fixed;
  top: 0;
  width: 100%;

  z-index: 2000;

  background: var(--nav-bg);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border-bottom: 1px solid var(--nav-border);

  transition:
    background 0.3s ease,
    box-shadow 0.3s ease;
}

/* Glass reflection */
.header::before {
  content: "";

  position: absolute;
  inset: 0;

  background:
    linear-gradient(
      to bottom,
      rgba(255,255,255,0.06),
      rgba(255,255,255,0)
    );

  pointer-events: none;
}

/* Scroll state */
.header.scrolled {
  background: var(--nav-bg-solid);

  box-shadow:
    0 8px 30px rgba(0,0,0,0.18);
}

/* ==============================
   NAVBAR CONTAINER
============================== */
.navbar {
  max-width: 1550px;

  margin: 0 auto;
  padding: 18px 32px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 24px;

  transition: padding 0.3s ease;
}

.header.scrolled .navbar {
  padding-top: 12px;
  padding-bottom: 12px;
}

/* ==============================
   LOGO
============================== */
.logo {
  flex-shrink: 0;

  color: #fff;
  text-decoration: none;

  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.05;

  letter-spacing: 1.5px;

  transition:
    opacity var(--transition),
    transform var(--transition);
}

.logo:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* ==============================
   NAVIGATION LINKS
============================== */
.nav-links {
  display: flex;
  justify-content: center;
  align-items: center;

  flex: 1;
}

.nav-links ul {
  display: flex;
  align-items: center;

  gap: 34px;

  list-style: none;
}

.nav-links ul li {
  position: relative;
}

.nav-links ul li a {
  position: relative;

  color: var(--nav-text-muted);

  text-decoration: none;

  font-size: clamp(0.95rem, 1vw, 1.05rem);
  font-weight: 600;

  letter-spacing: 0.3px;

  transition:
    color var(--transition),
    opacity var(--transition);
}

/* Hover / active */
.nav-links ul li a:hover,
.nav-links ul li a.active {
  color: var(--nav-text);
}

/* Underline effect */
.nav-links ul li a::after {
  content: "";

  position: absolute;

  left: 0;
  bottom: -8px;

  width: 0%;
  height: 2px;

  border-radius: 999px;

  background: var(--nav-accent);

  transition: width 0.3s ease;
}

.nav-links ul li a:hover::after,
.nav-links ul li a.active::after {
  width: 100%;
}

/* ==============================
   DROPDOWN
============================== */
.dropdown {
  position: relative;

  padding-bottom: 12px;
}

.dropbtn {
  cursor: pointer;
}

.dropdown-content {
  position: absolute;

  top: calc(100% + 12px);
  left: 0;

  min-width: 260px;

  padding: 12px;

  background: var(--dropdown-bg);

  border-radius: 18px;

  box-shadow: var(--shadow-lg);

  opacity: 0;
  visibility: hidden;

  transform: translateY(10px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;

  z-index: 999;
}

/* Dropdown links */
.dropdown-content a {
  display: block;

  padding: 14px 16px;

  border-radius: 12px;

  color: var(--dropdown-text);

  font-size: 0.95rem;
  font-weight: 600;

  transition:
    background 0.22s ease,
    transform 0.22s ease,
    color 0.22s ease;
}

.dropdown-content a:hover {
  background: rgba(76, 175, 80, 0.08);

  color: #1f7a38;

  transform: translateX(4px);
}

/* Desktop dropdown */
@media (min-width: 769px) {
  .dropdown:hover .dropdown-content {
    opacity: 1;
    visibility: visible;

    transform: translateY(0);
  }
}

/* ==============================
   USER PROFILE
============================== */
.user-profile {
  display: flex;
  align-items: center;

  gap: 14px;

  flex-shrink: 0;
}

.welcome-text {
  color: #fff;

  font-size: 0.95rem;
  font-weight: 500;
}

/* Profile image */
.profile-pic {
  width: 44px;
  height: 44px;

  border-radius: 50%;

  object-fit: cover;

  border: 2px solid rgba(255,255,255,0.14);

  cursor: pointer;

  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.profile-pic:hover {
  transform: scale(1.06);

  border-color: var(--nav-accent);

  box-shadow:
    0 0 0 4px rgba(76, 175, 80, 0.12),
    0 8px 20px rgba(0,0,0,0.22);
}

/* ==============================
   BUTTONS
============================== */
.login-btn,
.logout-btn {
  padding: 10px 18px;

  border-radius: 999px;

  border: 1px solid rgba(255,255,255,0.12);

  background: rgba(255,255,255,0.06);

  color: #fff;

  font-size: 0.92rem;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 0.25s ease,
    border-color 0.25s ease,
    transform 0.2s ease;
}

.login-btn:hover,
.logout-btn:hover {
  background: rgba(255,255,255,0.14);

  border-color: rgba(255,255,255,0.2);

  transform: translateY(-1px);
}

/* ==============================
   ACCESSIBILITY
============================== */
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--nav-accent);

  outline-offset: 3px;

  border-radius: 6px;
}

/* ==============================
   MOBILE ICONS
============================== */
.menuicon,
.closeicon {
  display: none;

  width: 30px;
  height: 30px;

  cursor: pointer;

  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.menuicon:hover,
.closeicon:hover {
  transform: scale(1.08);
  opacity: 0.9;
}

/* ==============================
   MOBILE OVERLAY
============================== */
.nav-overlay {
  position: fixed;
  inset: 0;

  background: rgba(0,0,0,0.45);

  backdrop-filter: blur(3px);

  opacity: 0;
  visibility: hidden;

  transition: 0.3s ease;

  z-index: 9990;
}

.nav-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* Prevent body scroll */
body.menu-open {
  overflow: hidden;
}

/* ==============================
   MOBILE STYLES
============================== */
@media (max-width: 768px) {

  .navbar {
    padding: 16px 20px;
  }

  /* Show hamburger */
  .menuicon {
    display: block;
  }

  /* Slide menu */
  .nav-links {
    position: fixed;

    top: 0;
    right: 0;

    width: 82%;
    max-width: 340px;
    height: 100vh;

    padding: 90px 28px 40px;

    background: rgba(15, 17, 22, 0.98);

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;

    overflow-y: auto;

    transform: translateX(100%);

    transition: transform 0.35s ease;

    box-shadow: -10px 0 30px rgba(0,0,0,0.25);

    z-index: 9999;
  }

  .nav-links.show {
    transform: translateX(0);
  }

  /* Close button */
  .closeicon {
    display: block;

    position: absolute;

    top: 28px;
    right: 24px;
  }

  /* Mobile list */
  .nav-links ul {
    width: 100%;

    flex-direction: column;
    align-items: flex-start;

    gap: 10px;
  }

  .nav-links ul li {
    width: 100%;

    opacity: 0;
    transform: translateX(20px);

    transition:
      opacity 0.3s ease,
      transform 0.3s ease;
  }

  .nav-links.show ul li {
    opacity: 1;
    transform: translateX(0);
  }

  /* Stagger animation */
  .nav-links.show ul li:nth-child(1) { transition-delay: 0.05s; }
  .nav-links.show ul li:nth-child(2) { transition-delay: 0.1s; }
  .nav-links.show ul li:nth-child(3) { transition-delay: 0.15s; }
  .nav-links.show ul li:nth-child(4) { transition-delay: 0.2s; }
  .nav-links.show ul li:nth-child(5) { transition-delay: 0.25s; }

  /* Mobile links */
  .nav-links ul li a {
    width: 100%;

    display: flex;
    align-items: center;

    padding: 14px 16px;

    border-radius: 12px;

    font-size: 1rem;
  }

  .nav-links ul li a:hover {
    background: var(--nav-hover-bg);
  }

  .nav-links ul li a::after {
    display: none;
  }

  /* Mobile dropdown */
  .dropdown-content {
    position: static;

    display: none;

    width: 100%;
    min-width: 100%;

    margin-top: 8px;
    padding: 8px;

    background: rgba(255,255,255,0.04);

    border: 1px solid rgba(255,255,255,0.06);

    border-radius: 14px;

    opacity: 1;
    visibility: visible;

    transform: none;

    box-shadow: none;
  }

  .dropdown.active .dropdown-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .dropdown-content a {
    color: #fff;
    font-size: 0.92rem;
  }

  .dropdown-content a:hover {
    background: rgba(255,255,255,0.08);

    color: #fff;
  }

  /* User profile */
  .welcome-text {
    display: none;
  }

  .profile-pic {
    width: 40px;
    height: 40px;
  }

  .login-btn,
  .logout-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
  }
}
/* ============================
   SIGNUP & UPGRADE BUTTONS
============================ */
.signup-btn {
    background: #5154db;
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.signup-btn:hover {
    background: #3f41b3;
}

.upgrade-btn {
    background: #4CAF50;
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.upgrade-btn:hover {
    background: #388E3C;
}
