/* Shared Navigation Styles for Both Pages */

/* CSS Variables */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --success: #059669;
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0891b2;
  
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Light theme (default) */
:root {
  --bg: var(--gray-50);
  --surface: #ffffff;
  --surface-alt: var(--gray-100);
  --border: var(--gray-200);
  --border-focus: var(--primary);
  --text: var(--gray-900);
  --text-muted: var(--gray-500);
  --text-light: var(--gray-400);
  --link: var(--primary);
  --link-hover: var(--primary-dark);
}

/* Dark theme */
[data-theme="dark"] {
  --bg: var(--gray-900);
  --surface: var(--gray-800);
  --surface-alt: var(--gray-700);
  --border: var(--gray-600);
  --border-focus: var(--primary-light);
  --text: var(--gray-100);
  --text-muted: var(--gray-400);
  --text-light: var(--gray-500);
  --link: var(--primary-light);
  --link-hover: var(--primary);
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

/* Auto dark mode based on system preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: var(--gray-900);
    --surface: var(--gray-800);
    --surface-alt: var(--gray-700);
    --border: var(--gray-600);
    --border-focus: var(--primary-light);
    --text: var(--gray-100);
    --text-muted: var(--gray-400);
    --text-light: var(--gray-500);
    --link: var(--primary-light);
    --link-hover: var(--primary);
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);
  }
}

/* Base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: var(--text);
  line-height: 1.5;
  margin: 0;
  min-height: 100vh;
}

/* Layout with sidebar */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  background: var(--gray-800);
  border-right: 1px solid var(--gray-700);
  padding: 1.5rem 0;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.main-content {
  flex: 1;
  margin-left: 280px;
  min-height: 100vh;
}

/* Sidebar branding */
.sidebar-brand {
  padding: 0 1.5rem 2rem 1.5rem;
  border-bottom: 1px solid var(--gray-700);
  margin-bottom: 1.5rem;
}

.sidebar-brand h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-brand p {
  color: var(--gray-300);
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.4;
}

/* Navigation menu */
.nav-menu {
  padding: 0 1rem;
}

.nav-section {
  margin-bottom: 2rem;
}

.nav-section-title {
  color: var(--gray-400);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  padding: 0 0.75rem;
}

.nav-item {
  display: block;
  width: 100%;
  padding: 0.75rem;
  margin-bottom: 0.25rem;
  border: none;
  background: none;
  color: white;
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-item:hover {
  background: var(--gray-700);
  color: white;
}

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

.nav-item.active:hover {
  background: var(--primary-dark);
  color: white;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.nav-item .nav-label {
  flex: 1;
}

.nav-item .nav-badge {
  background: var(--gray-700);
  color: var(--gray-300);
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem;
  font-weight: 600;
}

.nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.2);
  color: white;
}

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

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .mobile-menu-button {
    display: block;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 101;
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    cursor: pointer;
  }
}

@media (min-width: 769px) {
  .mobile-menu-button {
    display: none;
  }
}

/* Content area padding */
.content-wrapper {
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .content-wrapper {
    padding: 5rem 1rem 2rem 1rem;
  }
}

/* Dark mode adjustments */
[data-theme="dark"] .sidebar {
  border-right-color: var(--border);
}

[data-theme="dark"] .nav-item.active .nav-badge {
  background: rgba(255, 255, 255, 0.15);
}