/* ── SMS-to-PDF Design System ── */

/* ── Color Tokens (Dark default) ── */
:root {
  --bg-root: #0b0b14;
  --bg-surface: #13132a;
  --bg-elevated: #1a1a36;
  --bg-subtle: #21213e;
  --border-default: #2a2a4a;
  --border-strong: #3d3d5c;
  --text-primary: #ececf1;
  --text-secondary: #8b8ba3;
  --text-tertiary: #636e80;
  --accent-50: #7c6df00d;
  --accent-100: #7c6df01a;
  --accent-200: #7c6df033;
  --accent-400: #9b8ff5;
  --accent-500: #7c6df0;
  --accent-600: #6558d4;
  --success-100: #10b9811a;
  --success-500: #10b981;
  --error-100: #ef44441a;
  --error-500: #ef4444;
  --gradient-accent: linear-gradient(135deg, #7c6df0, #a78bfa);
  --glass-bg: rgba(19, 19, 42, 0.8);
  --glass-border: rgba(42, 42, 74, 0.6);

  /* Spacing (4px base) */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 24px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 22px;
  --text-3xl: 28px;
  --text-4xl: 36px;
  --text-5xl: 48px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
  --shadow-xl: 0 20px 60px rgba(0,0,0,.5);
  --shadow-glow: 0 0 20px rgba(124, 109, 240, .15);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;

  /* Z-index */
  --z-dropdown: 50;
  --z-sticky: 60;
  --z-modal: 100;
  --z-toast: 200;
}

/* ── Light Theme Override ── */
[data-theme="light"] {
  --bg-root: #f8f9fc;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #f0f1f5;
  --border-default: #e2e4ea;
  --border-strong: #d1d5db;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --accent-50: #7c6df00a;
  --accent-100: #7c6df015;
  --accent-200: #7c6df025;
  --gradient-accent: linear-gradient(135deg, #7c6df0, #a78bfa);
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(226, 228, 234, 0.6);
  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.1);
  --shadow-xl: 0 20px 60px rgba(0,0,0,.12);
  --shadow-glow: 0 0 20px rgba(124, 109, 240, .1);
}

/* ── Shared Reset ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-root);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Shared Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

/* ── Shared Button Base ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: var(--text-base);
  cursor: pointer;
  border: none;
  transition: all var(--duration-fast) ease;
  text-decoration: none;
  line-height: 1;
}
.btn:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* ── Theme Toggle ── */
.theme-toggle {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 18px;
  transition: all var(--duration-fast) ease;
  flex-shrink: 0;
  line-height: 1;
}
.theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}
/* Sun icon for dark mode, moon icon for light mode */
.theme-toggle::after { content: "\263C"; } /* sun */
[data-theme="light"] .theme-toggle::after { content: "\263E"; } /* moon */

/* ── Empty State ── */
.empty-state {
  padding: var(--sp-10) var(--sp-6);
  text-align: center;
  color: var(--text-secondary);
}
.empty-state-icon {
  font-size: 40px;
  margin-bottom: var(--sp-4);
  opacity: 0.5;
}
.empty-state-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--sp-2);
}
.empty-state-desc {
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 360px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
