/*
 * Base styles shared by the viewer and the admin portal:
 * design tokens, reset, typography and common buttons.
 * Theme colours are overridden at runtime by js/shared/theme.js.
 */

:root {
  --bg: #050b18;
  --bg-rgb: 5, 11, 24;
  --bg2: #0b1730;
  --bg2-rgb: 11, 23, 48;
  --surface: #0f1d3a;
  --surface-rgb: 15, 29, 58;
  --text: #e6eefc;
  --text-rgb: 230, 238, 252;
  --muted: #8ea3c7;
  --muted-rgb: 142, 163, 199;
  --accent: #2ee6ff;
  --accent-rgb: 46, 230, 255;
  --accent2: #3d7bff;
  --accent2-rgb: 61, 123, 255;

  --font-display: 'Space Grotesk', 'Segoe UI', Tahoma, 'Noto Sans Arabic', 'Noto Sans', system-ui, sans-serif;
  --font-body: 'Inter', 'Segoe UI', Tahoma, 'Noto Sans Arabic', 'Noto Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --radius: 14px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Text/icons placed on an accent-coloured background. */
  --on-accent: #050b18;

  /* Status colours. */
  --ok: #4ef0b3;
  --warn: #ffd27a;
  --warn-bg: #2a1f08;
  --danger: #ff6b84;

  color-scheme: dark;
}

/*
 * Light mode defaults (used before a theme is applied, e.g. on the sign-in
 * page). js/shared/theme.js sets data-mode on <html> and then overrides the
 * palette with the active theme's light colours.
 */
:root[data-mode='light'] {
  --bg: #f4f6fb;
  --bg-rgb: 244, 246, 251;
  --bg2: #e3e9f5;
  --bg2-rgb: 227, 233, 245;
  --surface: #ffffff;
  --surface-rgb: 255, 255, 255;
  --text: #0e1726;
  --text-rgb: 14, 23, 38;
  --muted: #5b6b85;
  --muted-rgb: 91, 107, 133;
  --accent: #0a84b8;
  --accent-rgb: 10, 132, 184;
  --accent2: #2a5bd7;
  --accent2-rgb: 42, 91, 215;
  --on-accent: #ffffff;

  --ok: #0f8a5f;
  --warn: #9a6400;
  --warn-bg: #fff4dc;
  --danger: #c8253f;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.6s ease;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
  line-height: 1.12;
  margin: 0;
}

p {
  margin: 0;
}

img,
video {
  max-width: 100%;
  display: block;
}

button {
  font: inherit;
  color: inherit;
}

.mono {
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
}

.icon {
  flex: none;
}

/* ---------- Buttons ---------- */

.ghost-btn,
.primary-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: rgba(var(--surface-rgb), 0.55);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s, transform 0.2s var(--ease-out);
}

.ghost-btn:hover {
  border-color: rgba(var(--accent-rgb), 0.7);
  background: rgba(var(--accent-rgb), 0.1);
}

.primary-btn {
  border-color: transparent;
  background: linear-gradient(120deg, var(--accent), var(--accent2));
  color: var(--on-accent);
  font-weight: 600;
}

.primary-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn:focus-visible,
.primary-btn:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
}
