/* ===================== PREMIUM MINIMALIST SIDEBAR ===================== */

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* Sidebar Panel */
.sidebar {
  position: fixed;
  top: 0;
  left: -340px;
  width: 320px;
  max-width: 88vw;
  height: 100vh;
  height: 100dvh;
  background: #ffffff;
  z-index: 2001;
  transition: left 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.05);
  font-family: 'Outfit', -apple-system, sans-serif;
  overflow: hidden;
}

[data-theme="dark"] .sidebar {
  background: #0f172a;
  box-shadow: 10px 0 40px rgba(0, 0, 0, 0.3);
  border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar.active {
  left: 0;
}

/* Close Button */
.sidebar-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  z-index: 10;
  font-size: 1.1rem;
}

.sidebar-close:hover {
  color: #0f172a;
  transform: rotate(90deg);
}

[data-theme="dark"] .sidebar-close:hover {
  color: #f8fafc;
}

/* Sidebar Header */
.sidebar-header {
  padding: 2.5rem 1.5rem 1.5rem;
  background: #0f172a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

[data-theme="dark"] .sidebar-header {
  background: #0b1121;
  border-bottom-color: rgba(255, 255, 255, 0.05);
}

.user-profile-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-avatar {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: #ffffff;
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-weight: 600;
  font-size: 1rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.15rem;
}

.user-handle {
  font-size: 0.75rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Navigation Body */
.sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-body::-webkit-scrollbar {
  width: 4px;
}
.sidebar-body::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar-body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
[data-theme="dark"] .sidebar-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Nav section label */
.sidebar-nav-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: #94a3b8;
  padding: 0 0.75rem 0.5rem;
}

[data-theme="dark"] .sidebar-nav-label {
  color: #64748b;
}

/* Nav */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Sidebar Link */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  color: #475569;
  text-decoration: none;
  font-weight: 400;
  font-size: 0.9rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

[data-theme="dark"] .sidebar-link {
  color: #cbd5e1;
}

.sidebar-link:hover {
  background: #f8fafc;
  color: #0f172a;
}

[data-theme="dark"] .sidebar-link:hover {
  background: #1e293b;
  color: #f8fafc;
}

.sidebar-link.active {
  background: #f1f5f9;
  color: #0f172a;
  font-weight: 500;
}

[data-theme="dark"] .sidebar-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}

.sidebar-link .link-icon {
  width: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  opacity: 0.8;
}

.sidebar-badge {
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0px 6px;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: none; /* Changed via JS */
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-left: auto;
  box-shadow: 0 2px 5px rgba(239, 68, 68, 0.3);
}

.sidebar-link.active .link-icon {
  opacity: 1;
}

/* Sidebar Footer */
.sidebar-footer {
  flex-shrink: 0;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .sidebar-footer {
  border-top-color: rgba(255, 255, 255, 0.04);
}

.theme-toggles {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Theme toggle */
.sidebar-theme-toggle {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #475569;
  font-weight: 400;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

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

.sidebar-theme-toggle:hover {
  background: #f8fafc;
  color: #0f172a;
}

[data-theme="dark"] .sidebar-theme-toggle:hover {
  background: #1e293b;
  color: #f8fafc;
}

.theme-icon-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 0.95rem;
  opacity: 0.8;
}

/* Auth Button */
.sidebar-auth-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff !important;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.sidebar-auth-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

[data-theme="dark"] .sidebar-auth-btn {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .sidebar-auth-btn:hover {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
}

.sidebar-auth-btn.logout {
  background: transparent;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: none;
}

.sidebar-auth-btn.logout:hover {
  background: rgba(239, 68, 68, 0.05);
  border-color: rgba(239, 68, 68, 0.5);
  transform: none;
}

[data-theme="dark"] .sidebar-auth-btn.logout {
  color: #f87171 !important;
  border-color: rgba(248, 113, 113, 0.3);
  background: transparent;
}

[data-theme="dark"] .sidebar-auth-btn.logout:hover {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.5);
}
