/**
 * Sidebar Styles
 * Menu latéral de navigation (inspiré de la maquette 4)
 */

/* Sidebar Container */
.sidebar {
  width: 280px;
  background: var(--bg-secondary, #1e293b);
  border-right: 1px solid var(--bg-tertiary, #334155);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 1000;
}

/* Sidebar Header */
.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid var(--bg-tertiary, #334155);
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-blue, #3b82f6), var(--accent-purple, #8b5cf6));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

/* Sidebar Menu */
.sidebar-menu {
  padding: 20px 0;
}

/* Menu Section */
.menu-section {
  padding: 16px 20px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #94a3b8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Menu Item */
.menu-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  color: var(--text-secondary, #94a3b8);
  user-select: none;
}

.menu-item:hover {
  background: var(--bg-tertiary, #334155);
  color: var(--text-primary, #f1f5f9);
}

.menu-item.active {
  background: var(--bg-tertiary, #334155);
  color: var(--accent-blue, #3b82f6);
}

.menu-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--accent-blue, #3b82f6);
}

.menu-icon {
  font-size: 20px;
  width: 20px;
  flex-shrink: 0;
}

/* Main Content Adjustment */
.main-content {
  margin-left: 280px;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* Header in Main Content */
.header {
  background: var(--bg-secondary, #1e293b);
  border-bottom: 1px solid var(--bg-tertiary, #334155);
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--bg-tertiary, #334155);
  border: none;
  color: var(--text-primary, #f1f5f9);
  cursor: pointer;
  font-size: 20px;
  align-items: center;
  justify-content: center;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary, #f1f5f9);
}

/* Content Area */
.content {
  padding: 32px;
  background: var(--bg-primary, #0f172a);
  min-height: calc(100vh - 81px); /* 81px = header height */
}

/* Scrollbar Styling */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: var(--bg-secondary, #1e293b);
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary, #334155);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--bg-hover, #475569);
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
  .sidebar {
    width: 260px;
  }
  
  .main-content {
    margin-left: 260px;
  }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .menu-toggle {
    display: flex;
  }
  
  .page-title {
    font-size: 20px;
  }
  
  .content {
    padding: 20px;
  }
}

/* Dark Mode Adjustments */
[data-theme="dark"] .sidebar {
  background: var(--bg-secondary);
  border-right-color: var(--bg-tertiary);
}

[data-theme="dark"] .menu-item:hover {
  background: var(--bg-tertiary);
}

[data-theme="dark"] .menu-item.active {
  background: var(--bg-tertiary);
  color: var(--accent-blue);
}

/* Light Mode Adjustments */
[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right-color: #e2e8f0;
}

[data-theme="light"] .menu-item {
  color: #475569;
}

[data-theme="light"] .menu-item:hover {
  background: #f8fafc;
  color: #0f172a;
}

[data-theme="light"] .menu-item.active {
  background: #f1f5f9;
  color: var(--accent-blue);
}

[data-theme="light"] .menu-section {
  color: #94a3b8;
}

/* Contrast Mode Adjustments */
[data-theme="contrast"] .sidebar {
  background: #000000;
  border-right: 2px solid #ffffff;
}

[data-theme="contrast"] .menu-item {
  color: #ffffff;
}

[data-theme="contrast"] .menu-item:hover {
  background: #1a1a1a;
  border-left: 3px solid #4da6ff;
}

[data-theme="contrast"] .menu-item.active {
  background: #1a1a1a;
  color: #4da6ff;
  border-left: 4px solid #4da6ff;
}

[data-theme="contrast"] .menu-item.active::before {
  width: 4px;
  background: #4da6ff;
}

[data-theme="contrast"] .menu-section {
  color: #ffffff;
  font-weight: 700;
}

[data-theme="contrast"] .logo {
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}
