/* Theme Variables - Light and Dark Mode */
:root {
  --brand: #08787F;
  --bg: #f6f8fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e5e7eb;
  --success: #16a34a;
  --danger: #dc2626;
  --info: #2563eb;
  --shadow: 0 8px 30px rgba(2, 12, 27, 0.06);
  --topbar-bg: rgba(255, 255, 255, 0.8);
  --input-bg: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-muted: #eef2ff;
  --item-bg: #ffffff;
  --button-bg: #ffffff;
  --button-text: #0f172a;
  --button-ghost-text: #475569;
  --flash-success-bg: #f0fdf4;
  --flash-success-border: #bbf7d0;
  --flash-success-text: #166534;
  --flash-danger-bg: #fef2f2;
  --flash-danger-border: #fecaca;
  --flash-danger-text: #991b1b;
  --flash-info-bg: #eff6ff;
  --flash-info-border: #bfdbfe;
  --flash-info-text: #1e40af;
  --empty-bg: #ffffff;
  --table-header-bg: #f8fafc;
  --badge-admin-bg: rgba(8, 120, 127, 0.12);
  --badge-user-bg: rgba(37, 99, 235, 0.14);
  --badge-user-text: #2563eb;
  --badge-viewer-bg: rgba(148, 163, 184, 0.18);
  --badge-viewer-text: #475569;
  --preview-bg: #0f172a;
  --preview-frame-bg: #111827;
  --overlay-bg: rgba(15, 23, 42, 0.55);
  --fallback-bg: #f8fafc;
  --fallback-pill-bg: rgba(100, 116, 139, 0.14);
  --timeline-line: rgba(8, 120, 127, 0.12);
  --stat-gradient-start: rgba(8, 120, 127, 0.12);
  --stat-gradient-end: rgba(8, 120, 127, 0.02);
  --stat-border: rgba(8, 120, 127, 0.18);
  --chip-bg: rgba(8, 120, 127, 0.12);
  --radial-gradient-1: radial-gradient(1000px 400px at 100% 0, rgba(8, 120, 127, 0.08), transparent 60%);
  --radial-gradient-2: radial-gradient(800px 300px at 0 100%, rgba(8, 120, 127, 0.06), transparent 60%);
}

[data-theme="dark"] {
  --brand: #0ea5ad;
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: #334155;
  --success: #22c55e;
  --danger: #ef4444;
  --info: #3b82f6;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  --topbar-bg: rgba(30, 41, 59, 0.8);
  --input-bg: #0f172a;
  --surface: #1e293b;
  --surface-alt: #0f172a;
  --surface-muted: #142033;
  --item-bg: #1f2b3d;
  --button-bg: #24344a;
  --button-text: #e2e8f0;
  --button-ghost-text: #94a3b8;
  --flash-success-bg: rgba(34, 197, 94, 0.18);
  --flash-success-border: rgba(34, 197, 94, 0.45);
  --flash-success-text: #4ade80;
  --flash-danger-bg: rgba(239, 68, 68, 0.16);
  --flash-danger-border: rgba(248, 113, 113, 0.4);
  --flash-danger-text: #fca5a5;
  --flash-info-bg: rgba(59, 130, 246, 0.16);
  --flash-info-border: rgba(96, 165, 250, 0.38);
  --flash-info-text: #bfdbfe;
  --empty-bg: rgba(15, 23, 42, 0.6);
  --table-header-bg: rgba(15, 23, 42, 0.75);
  --badge-admin-bg: rgba(14, 165, 173, 0.24);
  --badge-user-bg: rgba(59, 130, 246, 0.2);
  --badge-user-text: #93c5fd;
  --badge-viewer-bg: rgba(148, 163, 184, 0.28);
  --badge-viewer-text: #cbd5f5;
  --preview-bg: #000000;
  --preview-frame-bg: #0a0a0a;
  --overlay-bg: rgba(0, 0, 0, 0.75);
  --fallback-bg: #0f172a;
  --fallback-pill-bg: rgba(148, 163, 184, 0.2);
  --timeline-line: rgba(14, 165, 173, 0.2);
  --stat-gradient-start: rgba(14, 165, 173, 0.2);
  --stat-gradient-end: rgba(14, 165, 173, 0.05);
  --stat-border: rgba(14, 165, 173, 0.3);
  --chip-bg: rgba(14, 165, 173, 0.2);
  --radial-gradient-1: radial-gradient(1000px 400px at 100% 0, rgba(14, 165, 173, 0.15), transparent 60%);
  --radial-gradient-2: radial-gradient(800px 300px at 0 100%, rgba(14, 165, 173, 0.12), transparent 60%);
}

/* Dark mode toggle button styles */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.15s ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.theme-toggle:active {
  transform: translateY(0);
}

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

.card,
.btn,
.topbar,
input,
select,
.item,
.flash,
.stat-card,
.activity-item,
.timeline-content,
.timeline-icon,
.preview-panel,
.preview-header {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
