/**
 * Sidebar Component Styles
 * Desktop sidebar with collapsible navigation groups
 */

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR BASE
   ═══════════════════════════════════════════════════════════════════ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  height: 100dvh;
  background: var(--dash-card);
  border-right: 1px solid var(--dash-border);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
  overflow: hidden;
  transition: transform 0.3s ease, width 0.3s ease;
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-2xl);
  }
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR HEADER
   ═══════════════════════════════════════════════════════════════════ */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--dash-border);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
}

.sidebar-logo img {
  height: 32px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR PROFILE
   ═══════════════════════════════════════════════════════════════════ */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--dash-border);
  flex-shrink: 0;
}

.profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  border: 2px solid var(--dash-border);
}

.profile-status {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: var(--radius-full);
  border: 2px solid var(--dash-card);
}

.profile-status.online {
  background: var(--color-success);
}

.profile-status.offline {
  background: var(--color-text-muted);
}

.profile-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-name {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-email {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR NAVIGATION
   ═══════════════════════════════════════════════════════════════════ */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
}

/* Navigation Groups */
.nav-group {
  margin-bottom: var(--space-2);
}

.nav-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

.nav-group-header:hover {
  color: var(--color-text);
}

.nav-group-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.nav-group-header[aria-expanded="false"] .nav-group-icon {
  transform: rotate(-90deg);
}

.nav-group-items {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-top: var(--space-1);
}

.nav-group-header[aria-expanded="false"] + .nav-group-items {
  display: none;
}

/* Navigation Items */
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  color: var(--color-text-muted);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  position: relative;
  border: none;
  background: transparent;
  cursor: pointer;
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  color: var(--color-text);
  background: var(--dash-surface);
}

.nav-item.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.nav-item.active .nav-icon {
  color: var(--color-primary);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: currentColor;
}

/* Navigation Badge */
.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-full);
}

.nav-badge:empty,
.nav-badge[data-count="0"] {
  display: none;
}

/* Navigation Divider */
.nav-divider {
  height: 1px;
  background: var(--dash-border);
  margin: var(--space-4) 0;
}

/* Logout Button */
.nav-logout {
  margin-top: auto;
  color: var(--color-danger);
}

.nav-logout:hover {
  background: var(--color-danger-light);
  color: var(--color-danger);
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR OVERLAY (Mobile)
   ═══════════════════════════════════════════════════════════════════ */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-backdrop);
  z-index: calc(var(--z-sticky) - 1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.visible {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 1025px) {
  .sidebar-overlay {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR GLASS EFFECT
   ═══════════════════════════════════════════════════════════════════ */
.sidebar.glass-sidebar {
  background: rgba(var(--color-surface-rgb, 15, 23, 42), 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow:
    4px 0 30px rgba(var(--shadow-color, 0, 0, 0), 0.3),
    inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

/* ═══════════════════════════════════════════════════════════════════
   LOGO - Clean Style (Desktop)
   ═══════════════════════════════════════════════════════════════════ */
.sidebar-header.glass-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Logo principal - stil curat, fara cadru */
.sidebar-logo.logo-framed {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-xl);
  box-shadow: none;
  transition: all 0.3s ease;
}

.sidebar-logo.logo-framed:hover {
  transform: translateY(-2px);
  box-shadow: none;
}

.sidebar-logo.logo-framed img.logo-full {
  height: 48px;
  width: auto;
  max-width: 200px;
  border-radius: var(--radius-lg);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* GIF Logo Mini - ascuns când sidebar e deschis - stil heartbeat roșu */
.sidebar-logo-mini {
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-2);
  background: transparent;
  border: none;
  border-radius: 50%;
  transition: all 0.3s ease;
  position: relative;
  animation: sidebar-heartbeat 2s ease-in-out infinite;
}

/* Heartbeat pulse ring - roșu */
.sidebar-logo-mini::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(239, 68, 68, 0.6);
  animation: sidebar-pulse-ring 2s ease-in-out infinite;
  pointer-events: none;
}

/* Second pulse ring for more effect - roșu */
.sidebar-logo-mini::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: sidebar-pulse-ring 2s ease-in-out infinite 0.3s;
  pointer-events: none;
}

@keyframes sidebar-heartbeat {
  0%, 100% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.15);
  }
  28% {
    transform: scale(1);
  }
  42% {
    transform: scale(1.1);
  }
  56% {
    transform: scale(1);
  }
}

@keyframes sidebar-pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.4);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
  }
}

.sidebar-logo-mini:hover {
  transform: scale(1.1);
  animation: none;
}

.sidebar-logo-mini:hover::before,
.sidebar-logo-mini:hover::after {
  animation: none;
  opacity: 0;
}

.sidebar-logo-mini img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 50%;
  filter: drop-shadow(0 1px 3px rgba(239, 68, 68, 0.5));
}

/* Buton Collapse - doar pe desktop */
.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.sidebar-collapse-btn:hover {
  background: rgba(251, 146, 60, 0.15);
  border-color: rgba(251, 146, 60, 0.3);
  color: var(--color-primary);
}

.sidebar-collapse-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-collapse-btn .expand-icon {
  display: none;
}

/* Ascunde buton collapse pe mobil */
@media (max-width: 1024px) {
  .sidebar-collapse-btn {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   SIDEBAR COLLAPSED STATE (doar iconite)
   ═══════════════════════════════════════════════════════════════════ */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar.collapsed .sidebar-header.glass-header {
  padding: var(--space-4) var(--space-2);
  justify-content: center;
}

/* Ascunde logo principal, afiseaza GIF */
.sidebar.collapsed .sidebar-logo.logo-framed {
  display: none;
}

.sidebar.collapsed .sidebar-logo-mini {
  display: flex;
}

/* Buton collapse - schimba iconița */
.sidebar.collapsed .sidebar-collapse-btn {
  position: absolute;
  right: -16px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  background: var(--color-bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.sidebar.collapsed .sidebar-collapse-btn .collapse-icon {
  display: none;
}

.sidebar.collapsed .sidebar-collapse-btn .expand-icon {
  display: block;
}

/* Ascunde profile info */
.sidebar.collapsed .sidebar-profile {
  padding: var(--space-3) var(--space-2);
  justify-content: center;
}

.sidebar.collapsed .profile-info {
  display: none;
}

.sidebar.collapsed .profile-avatar-wrap.avatar-3d .profile-avatar {
  width: 40px;
  height: 40px;
}

/* Navigare - doar iconite */
.sidebar.collapsed .nav-group {
  margin: var(--space-1) var(--space-2);
  padding: 0;
}

.sidebar.collapsed .nav-group-header {
  display: none;
}

.sidebar.collapsed .nav-group-items {
  max-height: none !important;
  padding: 0;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
}

.sidebar.collapsed .nav-item span:not(.sidebar-icon-3d):not(.nav-badge) {
  display: none;
}

.sidebar.collapsed .nav-item .nav-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  min-width: 18px;
  height: 18px;
  font-size: 10px;
}

.sidebar.collapsed .sidebar-icon-3d {
  margin-right: 0;
}

/* Footer collapsed */
.sidebar.collapsed .sidebar-footer {
  padding: var(--space-3) var(--space-2);
}

.sidebar.collapsed .sidebar-footer .nav-item span:not(.sidebar-icon-3d) {
  display: none;
}

.sidebar.collapsed .sidebar-footer .nav-item {
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════════════
   PROFILE CARD GLASS
   ═══════════════════════════════════════════════════════════════════ */
.sidebar-profile.glass-profile {
  margin: var(--space-3) var(--space-3);
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-xl);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.profile-avatar-wrap.avatar-3d {
  position: relative;
}

.profile-avatar-wrap.avatar-3d .profile-avatar {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    inset 0 -2px 6px rgba(0, 0, 0, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════
   NAV GROUPS GLASS
   ═══════════════════════════════════════════════════════════════════ */
.nav-group.glass-group {
  margin-bottom: var(--space-3);
  padding: var(--space-2);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-lg);
}

.nav-group.glass-group .nav-group-header {
  padding: var(--space-2) var(--space-2);
  margin-bottom: var(--space-2);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════════════════════════════════
   NAV ITEMS WITH 3D ICONS
   ═══════════════════════════════════════════════════════════════════ */
.nav-item.glass-item {
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-lg);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.glass-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateX(4px);
}

.nav-item.glass-item.active {
  background: #1d4ed8;
  border-color: #3b82f6;
  color: #ffffff;
}

/* 3D Icon wrapper for sidebar */
.sidebar-icon-3d {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  transition: all 0.25s ease;

  /* 3D relief */
  box-shadow:
    2px 2px 6px rgba(0, 0, 0, 0.3),
    -1px -1px 4px rgba(255, 255, 255, 0.05),
    inset 1px 1px 2px rgba(255, 255, 255, 0.15);
}

.sidebar-icon-3d svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

/* Sidebar icon color variants */
.sidebar-icon-3d.icon-home {
  background: linear-gradient(145deg, #3b82f6, #1d4ed8);
}

.sidebar-icon-3d.icon-calendar {
  background: linear-gradient(145deg, #22c55e, #16a34a);
}

.sidebar-icon-3d.icon-messages {
  background: linear-gradient(145deg, #06b6d4, #0891b2);
}

.sidebar-icon-3d.icon-notifications {
  background: linear-gradient(145deg, #f97316, #ea580c);
}

.sidebar-icon-3d.icon-favorite {
  background: linear-gradient(145deg, #ec4899, #db2777);
}

.sidebar-icon-3d.icon-profile {
  background: linear-gradient(145deg, #6366f1, #4f46e5);
}

.sidebar-icon-3d.icon-settings {
  background: linear-gradient(145deg, #64748b, #475569);
}

.sidebar-icon-3d.icon-support {
  background: linear-gradient(145deg, #14b8a6, #0d9488);
}

.sidebar-icon-3d.icon-logout {
  background: linear-gradient(145deg, #ef4444, #dc2626);
}

/* Active state for icons */
.nav-item.glass-item.active .sidebar-icon-3d {
  box-shadow:
    inset 2px 2px 4px rgba(0, 0, 0, 0.3),
    inset -1px -1px 2px rgba(255, 255, 255, 0.1);
  transform: scale(0.95);
}

/* ═══════════════════════════════════════════════════════════════════
   NAV BADGES (3D STYLE)
   ═══════════════════════════════════════════════════════════════════ */
.nav-badge.badge-3d {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  font-size: 11px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
  border: none;
}

/* ═══════════════════════════════════════════════════════════════════
   LOGOUT BUTTON GLASS
   ═══════════════════════════════════════════════════════════════════ */
.nav-logout.glass-logout {
  margin: var(--space-2) var(--space-3);
  padding: var(--space-3) var(--space-3);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-lg);
}

.nav-logout.glass-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateX(4px);
}

/* ═══════════════════════════════════════════════════════════════════
   NAV DIVIDER GLASS
   ═══════════════════════════════════════════════════════════════════ */
.nav-divider.glass-divider {
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1) 20%,
    rgba(255, 255, 255, 0.1) 80%,
    transparent
  );
  margin: var(--space-4) var(--space-3);
}

/* ═══════════════════════════════════════════════════════════════════
   COLLAPSED STATE - HIDE GLASS BACKGROUNDS
   Keep only icons visible when sidebar is collapsed
   ═══════════════════════════════════════════════════════════════════ */
.sidebar.collapsed .glass-profile,
.sidebar.collapsed .glass-group,
.sidebar.collapsed .glass-item,
.sidebar.collapsed .glass-header,
.sidebar.collapsed .glass-divider,
.sidebar.collapsed .glass-logout {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

.sidebar.collapsed .nav-group.glass-group {
  padding: 0;
  margin-bottom: var(--space-1);
}

.sidebar.collapsed .sidebar-profile.glass-profile {
  margin: var(--space-2);
  padding: var(--space-2);
}

