/* Theme Switcher Styles */

/* Light/Dark Mode Variables */
:root {
  /* Light Theme (Default) */
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-color: #2c3e50;
  --border-color: rgba(0, 0, 0, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.1);
  --muted-color: #95a5a6;
  --header-bg: #ffffff;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-color: #1a1a2e;
  --card-bg: #222642;
  --text-color: #e6e6e6;
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --muted-color: #a0aec0;
  --header-bg: #222642;
}

/* Apply Theme Variables */
body {
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.card, .table, .chart-container, .stat-card {
  background-color: var(--card-bg);
  border-color: var(--border-color);
}

.navbar {
  background-color: var(--header-bg);
}

.table thead th {
  background-color: rgba(0, 0, 0, 0.02);
}

[data-theme="dark"] .table thead th {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Theme Toggle Button */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 1000;
  transition: transform 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle .fa-sun,
.theme-toggle .fa-moon {
  font-size: 1.5rem;
}

[data-theme="dark"] .theme-toggle .fa-sun {
  display: inline-block;
}

[data-theme="dark"] .theme-toggle .fa-moon {
  display: none;
}

[data-theme="light"] .theme-toggle .fa-sun {
  display: none;
}

[data-theme="light"] .theme-toggle .fa-moon {
  display: inline-block;
}

/* Dark Mode Specific Overrides */
[data-theme="dark"] .text-dark {
  color: var(--text-color) !important;
}

[data-theme="dark"] .border {
  border-color: var(--border-color) !important;
}

[data-theme="dark"] .bg-light {
  background-color: var(--card-bg) !important;
}

[data-theme="dark"] .card {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

/* Form Controls in Dark Mode */
[data-theme="dark"] .form-control {
  background-color: #2d325a;
  border-color: var(--border-color);
  color: var(--text-color);
}

[data-theme="dark"] .form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Button Overrides for Dark Mode */
[data-theme="dark"] .btn-outline-secondary {
  color: #a0aec0;
  border-color: #a0aec0;
}

[data-theme="dark"] .btn-outline-secondary:hover {
  background-color: #a0aec0;
  color: #222642;
}