/* ═══════════════════════════════════════════════════════════════════
   Magnus Board — Shared CSS (Reset, Typography, CSS Variables)
   ═══════════════════════════════════════════════════════════════════ */

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

html, body {
  width: 100%;
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, video, canvas {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

input, textarea, select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

/* ── CSS Variables ─────────────────────────────────────────────── */
:root {
  /* Presenter (dark theme) */
  --board-bg: #0a0a0f;
  --board-text: #e0e0e0;
  --board-text-dim: #888;
  --board-accent: #FFD700;
  --board-accent-rgb: 255, 215, 0;
  --board-success: #00c864;
  --board-error: #ff4444;
  --board-surface: rgba(255, 255, 255, 0.05);
  --board-border: rgba(255, 255, 255, 0.1);

  /* Admin (light/dark) */
  --admin-bg: #1a1a2e;
  --admin-surface: #16213e;
  --admin-surface-hover: #1e2d4a;
  --admin-border: #2a2a4a;
  --admin-text: #e0e0e0;
  --admin-text-dim: #888;
  --admin-primary: #6366f1;
  --admin-primary-hover: #818cf8;
  --admin-danger: #ef4444;
  --admin-success: #22c55e;
  --admin-warning: #f59e0b;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
  --font-display: 'Space Grotesk', 'Inter', sans-serif;

  /* Spacing */
  --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;

  /* Radii */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --transition-fast: 150ms var(--ease-out);
  --transition-normal: 250ms var(--ease-out);
  --transition-slow: 400ms var(--ease-out);

  /* Slide dimensions */
  --slide-width: 1920;
  --slide-height: 1080;
  --slide-aspect: calc(16 / 9);
}

/* ── Typography Utilities ──────────────────────────────────────── */
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-dim { color: var(--board-text-dim); }
.text-accent { color: var(--board-accent); }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ── Loading spinner ───────────────────────────────────────────── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--board-border);
  border-top-color: var(--board-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Toast notifications ───────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: #fff;
  background: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: toastIn 300ms var(--ease-out);
  max-width: 400px;
}

.toast.success { background: #166534; }
.toast.error { background: #991b1b; }
.toast.warning { background: #92400e; }

.toast.removing {
  animation: toastOut 250ms var(--ease-out) forwards;
}

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}
