/* ==========================================================================
   Navigation Bar Styles (Playful Theme)
   ========================================================================== */
.navbar {
  position: sticky;
  top: 1rem;
  z-index: 100;
  max-width: 1160px;
  margin: 0.75rem auto 0;
  padding: 0 1rem;
}

.navbar-container {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-full);
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.1),
              inset 0 -2px 6px rgba(99, 102, 241, 0.04),
              inset 0 2px 6px #ffffff;
  padding: 0.65rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-fun);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), #ec4899);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: white;
  font-size: 1.25rem;
  box-shadow: 2px 4px 10px rgba(99, 102, 241, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
}

.nav-link {
  font-family: var(--font-fun);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-alt);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: var(--transition);
}

.user-profile-badge:hover {
  background-color: #ffffff;
  box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.05);
}

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--border);
}

.user-name-text {
  font-family: var(--font-fun);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main);
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Flashcards Link Highlight in Topbar */
.nav-link-flashcards {
  font-weight: 700;
}

.nav-link-flashcards:hover {
  color: #ff6b6b;
  background-color: #fff0f0;
}

.nav-link-flashcards.active {
  color: #ff6b6b;
  background-color: #ffe3e3;
}

/* ==========================================================================
   Responsive Mobile Navbar
   ========================================================================== */
@media (max-width: 768px) {
  .navbar {
    top: 0.5rem;
    padding: 0 0.5rem;
  }

  .navbar-container {
    padding: 0.5rem 0.85rem;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .brand-logo {
    font-size: 1.15rem;
  }

  .nav-links {
    gap: 0.35rem;
    order: 3;
    width: 100%;
    justify-content: center;
    padding-top: 0.4rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--border);
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
  }

  .nav-auth {
    gap: 0.5rem;
  }
}
