/* Advanced Multi-Theme System */
:root {
  /* Light Theme (Default) */
  --primary-color: #1173d4;
  --primary-hover: #0f5aa5;
  --secondary-color: #f3f4f6;
  --accent-color: #059669;
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --bg-tertiary: #f3f4f6;
  --bg-card: #ffffff;
  
  /* Text Colors */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --text-inverse: #ffffff;
  
  /* Border Colors */
  --border-primary: #e5e7eb;
  --border-secondary: #d1d5db;
  --border-accent: #3b82f6;
  
  /* Shadow Colors */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  
  /* Theme transition */
  --theme-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme */
[data-theme="dark"] {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --secondary-color: #374151;
  --accent-color: #10b981;
  
  --bg-primary: #111827;
  --bg-secondary: #1f2937;
  --bg-tertiary: #374151;
  --bg-card: #1f2937;
  
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --text-tertiary: #9ca3af;
  --text-inverse: #1f2937;
  
  --border-primary: #374151;
  --border-secondary: #4b5563;
  --border-accent: #3b82f6;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* Academic Blue Theme */
[data-theme="academic"] {
  --primary-color: #1e40af;
  --primary-hover: #1e3a8a;
  --secondary-color: #dbeafe;
  --accent-color: #0891b2;
  
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --bg-card: #ffffff;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #64748b;
  --text-inverse: #ffffff;
  
  --border-primary: #cbd5e1;
  --border-secondary: #94a3b8;
  --border-accent: #1e40af;
  
  --shadow-sm: 0 1px 2px 0 rgba(30, 64, 175, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(30, 64, 175, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(30, 64, 175, 0.1);
}

/* Research Green Theme */
[data-theme="research"] {
  --primary-color: #059669;
  --primary-hover: #047857;
  --secondary-color: #d1fae5;
  --accent-color: #0891b2;
  
  --bg-primary: #f0fdf4;
  --bg-secondary: #ecfdf5;
  --bg-tertiary: #d1fae5;
  --bg-card: #ffffff;
  
  --text-primary: #14532d;
  --text-secondary: #166534;
  --text-tertiary: #22c55e;
  --text-inverse: #ffffff;
  
  --border-primary: #bbf7d0;
  --border-secondary: #86efac;
  --border-accent: #059669;
  
  --shadow-sm: 0 1px 2px 0 rgba(5, 150, 105, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(5, 150, 105, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(5, 150, 105, 0.1);
}

/* High Contrast Theme */
[data-theme="contrast"] {
  --primary-color: #0000ff;
  --primary-hover: #0000cc;
  --secondary-color: #ffff00;
  --accent-color: #ff00ff;
  
  --bg-primary: #ffffff;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f0f0;
  --bg-card: #ffffff;
  
  --text-primary: #000000;
  --text-secondary: #000000;
  --text-tertiary: #333333;
  --text-inverse: #ffffff;
  
  --border-primary: #000000;
  --border-secondary: #000000;
  --border-accent: #0000ff;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* Theme Toggle Styles */
.theme-toggle-container {
  position: relative;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.375rem;
  background: none;
  border: 1px solid var(--border-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--theme-transition);
}

.theme-toggle:hover {
  background-color: var(--bg-tertiary);
  color: var(--primary-color);
  border-color: var(--border-accent);
}

.theme-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--primary-color);
}

.theme-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  padding: 0.5rem;
  min-width: 10rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.5rem);
  transition: var(--theme-transition);
  z-index: 1000;
}

.theme-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: none;
  background: none;
  color: #1f2937;
  cursor: pointer;
  border-radius: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25;
  transition: all 0.2s ease;
}

.theme-option:hover {
  background-color: #f3f4f6;
  color: #1173d4;
}

.theme-option.active {
  background-color: #1173d4;
  color: #ffffff;
}