/* ===========================================
   Dark Theme Design System
   Extracted from Clinical Review Wireframe
   =========================================== */

/* ----- CSS Variables / Design Tokens ----- */
:root {
  /* Background Colors */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-input: #0d1117;
  
  /* Border Colors */
  --border-default: #21262d;
  --border-muted: #30363d;
  
  /* Text Colors */
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --text-link: #58a6ff;
  
  /* Accent Colors */
  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-green-emphasis: #238636;
  --accent-red: #f85149;
  --accent-yellow: #d29922;
  --accent-purple: #a371f7;
  --accent-purple-emphasis: #8957e5;
  
  /* Status Colors with Backgrounds */
  --status-success-bg: rgba(63, 185, 80, 0.1);
  --status-success-border: rgba(63, 185, 80, 0.3);
  --status-success-text: #3fb950;
  
  --status-danger-bg: rgba(248, 81, 73, 0.1);
  --status-danger-border: rgba(248, 81, 73, 0.3);
  --status-danger-text: #f85149;
  
  --status-warning-bg: rgba(210, 153, 34, 0.1);
  --status-warning-border: rgba(210, 153, 34, 0.3);
  --status-warning-text: #d29922;
  
  --status-info-bg: rgba(88, 166, 255, 0.1);
  --status-info-border: rgba(88, 166, 255, 0.2);
  --status-info-text: #58a6ff;
  
  --status-purple-bg: rgba(163, 113, 247, 0.15);
  --status-purple-border: rgba(163, 113, 247, 0.3);
  --status-purple-text: #a371f7;
  
  --status-neutral-bg: rgba(139, 148, 158, 0.2);
  --status-neutral-text: #8b949e;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  
  /* Font Sizes */
  --text-xs: 10px;
  --text-sm: 11px;
  --text-base: 12px;
  --text-md: 13px;
  --text-lg: 14px;
  --text-xl: 15px;
  --text-2xl: 16px;
  
  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;
  
  /* Spacing */
  --space-1: 4px;
  --space-2: 6px;
  --space-3: 8px;
  --space-4: 10px;
  --space-5: 12px;
  --space-6: 14px;
  --space-7: 16px;
  --space-8: 20px;
  --space-9: 24px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  font-size: var(--text-md);
  line-height: 1.5;
}

/* ----- Scrollbar Styles ----- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-muted);
  border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
  background: #484f58;
}

/* ----- Form Elements ----- */
::placeholder {
  color: var(--text-muted);
}

input:focus,
button:focus {
  outline: none;
}

input[type="text"],
input[type="search"] {
  width: 100%;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-muted);
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-size: var(--text-lg);
  font-family: var(--font-family);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-green);
  cursor: pointer;
}

/* ----- Button Styles ----- */
button {
  font-family: var(--font-family);
  transition: all 0.15s ease;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
}

button:hover {
  filter: brightness(1.1);
}

/* Primary Button (Green) */
.btn-primary {
  padding: var(--space-4) var(--space-5);
  background-color: var(--accent-green-emphasis);
  color: white;
  border-radius: var(--radius-md);
  font-size: var(--text-md);
  font-weight: var(--font-semibold);
}

/* Secondary Button */
.btn-secondary {
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
}

/* Ghost Button */
.btn-ghost {
  padding: var(--space-3) var(--space-4);
  background-color: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-muted);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
}

/* Danger Button */
.btn-danger {
  background-color: var(--accent-red);
  color: white;
}

/* Warning Button */
.btn-warning {
  background-color: #9e6a03;
  color: white;
}

/* Purple Button */
.btn-purple {
  background-color: var(--accent-purple-emphasis);
  color: white;
}

/* Small Button */
.btn-sm {
  padding: var(--space-1) var(--space-4);
  font-size: var(--text-base);
}

/* ----- Badge / Pill Styles ----- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

.badge-neutral {
  background-color: var(--status-neutral-bg);
  color: var(--status-neutral-text);
}

.badge-info {
  background-color: var(--status-info-bg);
  color: var(--status-info-text);
}

.badge-success {
  background-color: var(--status-success-bg);
  color: var(--status-success-text);
}

.badge-warning {
  background-color: var(--status-warning-bg);
  color: var(--status-warning-text);
}

.badge-danger {
  background-color: var(--status-danger-bg);
  color: var(--status-danger-text);
}

.badge-purple {
  background-color: var(--status-purple-bg);
  color: var(--status-purple-text);
}

/* Count Badge (for nav items) */
.badge-count {
  padding: 1px 6px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
}

.badge-count-default {
  background-color: var(--border-muted);
  color: var(--text-secondary);
}

.badge-count-alert {
  background-color: var(--accent-red);
  color: white;
}

/* ----- Card Styles ----- */
.card {
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  border: 1px solid var(--border-default);
}

.card-elevated {
  background-color: var(--bg-secondary);
}

.card-header {
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-4);
}

/* ----- Panel Styles ----- */
.panel {
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-secondary {
  background-color: var(--bg-secondary);
}

.panel-header {
  padding: var(--space-5) var(--space-7);
  border-bottom: 1px solid var(--border-default);
}

/* ----- Navigation Styles ----- */
.nav-section-title {
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 var(--space-5);
  margin-bottom: var(--space-3);
}

.nav-item {
  display: flex;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  margin: 0 var(--space-3);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text-secondary);
  font-size: var(--text-md);
}

.nav-item:hover {
  background-color: var(--bg-tertiary);
}

.nav-item-active {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: var(--font-medium);
}

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

/* ----- List Item Styles ----- */
.list-item {
  padding: var(--space-5) var(--space-7);
  border-bottom: 1px solid var(--border-default);
  cursor: pointer;
  transition: all 0.15s;
}

.list-item:hover {
  background-color: var(--bg-secondary);
}

.list-item-selected {
  background-color: var(--bg-secondary);
}

.list-item-bordered-left {
  border-left: 3px solid var(--border-default);
}

/* ----- Tab Styles ----- */
.tab {
  padding: var(--space-4) var(--space-6);
  background-color: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: var(--text-md);
  color: var(--text-secondary);
  cursor: pointer;
}

.tab:hover {
  color: var(--text-primary);
}

.tab-active {
  color: var(--text-primary);
  font-weight: var(--font-medium);
  border-bottom-color: var(--accent-blue);
}

/* ----- Alert / Banner Styles ----- */
.alert {
  padding: var(--space-4) var(--space-7);
  display: flex;
  align-items: center;
  gap: var(--space-5);
  font-size: var(--text-md);
}

.alert-warning {
  background-color: var(--status-warning-bg);
  border-bottom: 1px solid var(--status-warning-border);
  color: var(--status-warning-text);
}

.alert-danger {
  background-color: var(--status-danger-bg);
  border-bottom: 1px solid var(--status-danger-border);
  color: var(--status-danger-text);
}

.alert-info {
  background-color: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  border-radius: var(--radius-lg);
  color: var(--status-info-text);
}

/* ----- Checkbox Item (Criteria) ----- */
.checkbox-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background-color: var(--bg-primary);
  cursor: pointer;
}

.checkbox-item-checked {
  background-color: var(--status-success-bg);
  border-color: var(--status-success-border);
}

.checkbox-item-checked .checkbox-label {
  color: var(--status-success-text);
}

/* ----- Progress Bar ----- */
.progress-bar {
  width: 50px;
  height: 3px;
  background-color: var(--bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  transition: width 0.3s;
}

/* ----- Avatar ----- */
.avatar {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: var(--font-semibold);
}

.avatar-sm {
  width: 28px;
  height: 28px;
  font-size: 11px;
}

.avatar-md {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.avatar-lg {
  width: 36px;
  height: 36px;
  font-size: 14px;
}

/* ----- Utility Classes ----- */
.text-mono {
  font-family: var(--font-mono);
}

.text-link {
  color: var(--accent-blue);
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.font-semibold {
  font-weight: var(--font-semibold);
}

.font-medium {
  font-weight: var(--font-medium);
}

/* ----- Layout Helpers ----- */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-1 {
  flex: 1;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

.overflow-hidden {
  overflow: hidden;
}

.overflow-y-auto {
  overflow-y: auto;
}
