/* ===== THEME TOGGLE STYLES ===== */
/* Light mode variables */
[data-theme="light"] {
  --bg: #f8fafc;
  --card: #ffffff;
  --card2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --dim: #64748b;
  /* Keep accent colors the same */
  --teal: #14b8a6;
  --cyan: #06b6d4;
  --purple: #8b5cf6;
  --amber: #f59e0b;
  --red: #ef4444;
  --green: #22c55e;
  --dim3: #475569;
  /* Glass morphism adjustments for light mode */
  --glass: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(20, 184, 166, 0.15);
  /* Brand colors for light mode */
  --brand: #8b5cf6;
  --brand-light: #a78bfa;
  --pink: #ec4899;
}

/* Dark mode (default) */
:root {
  color-scheme: dark;
}

/* Respects prefers-color-scheme */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8fafc;
    --card: #ffffff;
    --card2: #f1f5f9;
    --border: #e2e8f0;
    --text: #0f172a;
    --dim: #64748b;
    --teal: #14b8a6;
    --cyan: #06b6d4;
    --purple: #8b5cf6;
    --amber: #f59e0b;
    --red: #ef4444;
    --green: #22c55e;
    --dim3: #475569;
    --glass: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(20, 184, 166, 0.15);
    --brand: #8b5cf6;
    --brand-light: #a78bfa;
    --pink: #ec4899;
    color-scheme: light;
  }
}

/* Theme toggle button styling */
.theme-toggle {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 50px;
  height: 28px;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
  position: relative;
  flex-shrink: 0;
}

.theme-toggle:hover {
  border-color: var(--teal);
  box-shadow: 0 0 12px rgba(20, 184, 166, 0.1);
}

.theme-toggle.active {
  background: rgba(20, 184, 166, 0.1);
  border-color: var(--teal);
}

.theme-toggle-slider {
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, var(--teal), var(--cyan));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  position: absolute;
  left: 2px;
  font-size: 14px;
  color: white;
}

.theme-toggle.active .theme-toggle-slider {
  transform: translateX(22px);
}

.theme-toggle-icon-sun {
  opacity: 1;
  transition: opacity 0.3s ease;
}

.theme-toggle.active .theme-toggle-icon-sun {
  opacity: 0;
}

.theme-toggle-icon-moon {
  opacity: 0;
  transition: opacity 0.3s ease;
  position: absolute;
  left: 26px;
}

.theme-toggle.active .theme-toggle-icon-moon {
  opacity: 1;
}

/* Smooth transitions for theme changes */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Card and container transitions */
.card,
.kpi,
.alert-item,
nav,
.sidebar,
.auth-card,
.meet-card {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Input transitions */
input,
textarea,
select {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Light mode specific adjustments */
[data-theme="light"] {
  /* Increase contrast for readability */
}

[data-theme="light"] body::before {
  background: radial-gradient(ellipse 80% 60% at 20% 10%, rgba(139, 92, 246, 0.05), transparent),
              radial-gradient(ellipse 60% 50% at 80% 80%, rgba(236, 72, 153, 0.03), transparent);
}

[data-theme="light"] .auth-overlay {
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(241, 245, 249, 0.95));
}

[data-theme="light"] nav {
  background: rgba(248, 250, 252, 0.95);
  border-bottom-color: rgba(226, 232, 240, 0.4);
}

[data-theme="light"] .sidebar {
  background: rgba(248, 250, 252, 0.92);
  border-right-color: rgba(226, 232, 240, 0.3);
}

[data-theme="light"] .tb-timestamp,
[data-theme="light"] .tb-date {
  background: var(--card2);
  border-color: var(--border);
}

[data-theme="light"] .alert-red {
  background: rgba(239, 68, 68, 0.08);
}

[data-theme="light"] .alert-orange {
  background: rgba(249, 115, 22, 0.08);
}

[data-theme="light"] .alert-yellow {
  background: rgba(245, 158, 11, 0.06);
}

/* Accessibility: respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .theme-toggle-slider,
  .theme-toggle-icon-sun,
  .theme-toggle-icon-moon,
  html,
  body,
  .card,
  .kpi,
  .alert-item,
  input,
  textarea,
  select {
    transition: none !important;
  }
}
