/* ============================================
   Navbar Styles
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  z-index: var(--z-fixed);
  transition: all var(--transition-base);
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-md);
}

.navbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo Area */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.navbar-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: var(--shadow-red);
}

.navbar-brand-text {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  letter-spacing: 0.05em;
}

.navbar-brand-text span {
  color: var(--primary);
}

/* Navigation Links */
.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-link {
  position: relative;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
  background: var(--red-50);
}

.nav-link.active {
  color: var(--primary);
  background: var(--red-50);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--primary);
  border-radius: var(--radius-full);
}

/* Right Actions */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  transition: all var(--transition-fast);
  background: transparent;
  border: none;
  cursor: pointer;
}

.nav-btn:hover {
  background: var(--gray-100);
  color: var(--primary);
}

.nav-btn-login {
  padding: var(--space-2) var(--space-5);
  height: 40px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--red-700), var(--red-600));
  color: var(--white);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  display: flex;
  align-items: center;
  gap: var(--space-1);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-red);
  white-space: nowrap;
}

.nav-btn-login:hover {
  background: linear-gradient(135deg, var(--red-600), var(--red-500));
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -8px rgba(185, 28, 28, 0.5);
}

/* ---------- User Menu (logged-in state) ---------- */
.user-menu {
  position: relative;
  display: none;
  align-items: center;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  overflow: hidden;
  border: 2.5px solid transparent;
  background: linear-gradient(white, white) padding-box,
    linear-gradient(135deg, var(--primary), var(--accent)) border-box;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.user-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(185, 28, 28, 0.25);
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ---------- User Dropdown ---------- */
.user-dropdown {
  position: absolute;
  top: 52px;
  right: 0;
  width: 280px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.05);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1000;
}

.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.dd-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dd-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.dd-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dd-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.dd-id {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dd-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  margin: 10px 0;
}

.dd-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dd-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
  text-align: left;
}

.dd-menu-item:hover {
  background: var(--red-50);
  color: var(--primary);
}

.dd-menu-item.danger {
  color: #dc2626;
}

.dd-menu-item.danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

/* Dropdown progress ring */
.dd-progress {
  display: none;
  padding: 12px 0;
  align-items: center;
  gap: 16px;
}

.dd-progress-ring {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.dd-progress-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.pr-bg {
  fill: none;
  stroke: #f3f4f6;
  stroke-width: 4;
}

.pr-fg {
  fill: none;
  stroke: var(--primary);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
  transition: stroke-dashoffset 1s ease;
}

.dd-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pr-num {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.pr-label {
  font-size: 10px;
  color: var(--text-muted);
}

.dd-stats {
  flex: 1;
  display: flex;
  gap: 12px;
}

.dd-stat-item {
  text-align: center;
  flex: 1;
}

.dd-stat-val {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.dd-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.dd-history {
  display: none;
  padding: 8px 0;
}

.dd-history-title {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.hist-item {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 4px 0;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--gray-100);
  padding: var(--space-4);
  flex-direction: column;
  gap: var(--space-2);
  z-index: var(--z-fixed);
  transform: translateY(-10px);
  opacity: 0;
  pointer-events: none;
  transition: all var(--transition-base);
}

.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.mobile-menu .nav-link {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-lg);
  width: 100%;
  text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
  .navbar-nav {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .mobile-menu {
    display: flex;
  }

  .navbar-brand-text {
    font-size: var(--text-lg);
  }
}

@media (max-width: 480px) {
  .navbar-brand-text {
    display: none;
  }
}

/* ---------- Enhanced Navbar Variant ---------- */
.navbar-fun {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}

.navbar-fun .nav-link {
  position: relative;
  overflow: hidden;
}

.navbar-fun .nav-link::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: all 0.3s ease;
  transform: translateX(-50%);
  border-radius: var(--radius-full);
}

.navbar-fun .nav-link:hover::before,
.navbar-fun .nav-link.active::before {
  width: 60%;
}

.navbar-fun .nav-link.active::after {
  display: none;
}
