/* Smart Kos — theme.css
 * Variabel warna & tipografi. Dark default mengikuti prefer; toggle manual via [data-theme].
 */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "JetBrains Mono",
    Consolas, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 2rem;
  --fs-3xl: 2.5rem;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  --shadow-sm: 0 1px 2px rgb(15 23 42 / 0.08);
  --shadow-md: 0 4px 12px rgb(15 23 42 / 0.10), 0 1px 3px rgb(15 23 42 / 0.06);
  --shadow-lg: 0 16px 40px rgb(15 23 42 / 0.20);

  --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

  --tap-min: 44px;
}

/* Light theme */
:root,
:root[data-theme="light"] {
  --color-bg: #f1f5f9;
  --color-bg-elev: #ffffff;
  --color-bg-elev-2: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-border-strong: #cbd5e1;

  --color-text: #0f172a;
  --color-text-muted: #475569;
  --color-text-subtle: #64748b;

  --color-accent: #0d9488;
  --color-accent-hover: #0f766e;
  --color-accent-contrast: #ffffff;
  --color-accent-soft: rgb(13 148 136 / 0.10);

  --color-info: #2563eb;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-danger-hover: #b91c1c;

  --color-focus: #0d9488;

  --color-online: #16a34a;
  --color-offline: #94a3b8;

  --color-relay-on: #f59e0b;
  --color-relay-off: #475569;

  --grad-hero: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  --grad-card: linear-gradient(135deg, rgb(13 148 136 / 0.06), rgb(13 148 136 / 0));
}

/* Dark theme — default ke prefers, atau saat data-theme=dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --color-bg: #0b1220;
    --color-bg-elev: #111c2e;
    --color-bg-elev-2: #162236;
    --color-surface: #111c2e;
    --color-border: #1f2c44;
    --color-border-strong: #2d3c58;

    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    --color-text-subtle: #64748b;

    --color-accent: #2dd4bf;
    --color-accent-hover: #5eead4;
    --color-accent-contrast: #06201f;
    --color-accent-soft: rgb(45 212 191 / 0.12);

    --color-info: #60a5fa;
    --color-success: #4ade80;
    --color-warning: #fbbf24;
    --color-danger: #f87171;
    --color-danger-hover: #ef4444;

    --color-focus: #5eead4;

    --color-online: #4ade80;
    --color-offline: #64748b;

    --color-relay-on: #fbbf24;
    --color-relay-off: #64748b;

    --grad-hero: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
    --grad-card: linear-gradient(135deg, rgb(45 212 191 / 0.10), rgb(45 212 191 / 0));
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0b1220;
  --color-bg-elev: #111c2e;
  --color-bg-elev-2: #162236;
  --color-surface: #111c2e;
  --color-border: #1f2c44;
  --color-border-strong: #2d3c58;

  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  --color-text-subtle: #64748b;

  --color-accent: #2dd4bf;
  --color-accent-hover: #5eead4;
  --color-accent-contrast: #06201f;
  --color-accent-soft: rgb(45 212 191 / 0.12);

  --color-info: #60a5fa;
  --color-success: #4ade80;
  --color-warning: #fbbf24;
  --color-danger: #f87171;
  --color-danger-hover: #ef4444;

  --color-focus: #5eead4;

  --color-online: #4ade80;
  --color-offline: #64748b;

  --color-relay-on: #fbbf24;
  --color-relay-off: #64748b;

  --grad-hero: linear-gradient(135deg, #0f766e 0%, #134e4a 100%);
  --grad-card: linear-gradient(135deg, rgb(45 212 191 / 0.10), rgb(45 212 191 / 0));
}
