/*
 * gg-theme.css — Game Gizmo Web Theme
 *
 * Built on Material Web Components (@material/web) with Game Gizmo design tokens.
 * Import this file in all Game Gizmo web pages for consistent styling.
 *
 * Design tokens sourced from backend/mongo-fastapi/app/templates/share_game.html
 */

/* ─── Google Fonts ─────────────────────────────────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;700&display=swap");

/* ─── Material 3 Colour Role Tokens — Game Gizmo Palette ────────────────────
 *
 * Mapping:
 *   --md-sys-color-background      → #1a1a1a  (page background)
 *   --md-sys-color-surface         → #2a2a2a  (card / surface)
 *   --md-sys-color-primary         → #ffde59  (accent / CTA)
 *   --md-sys-color-on-primary      → #1a1a1a  (text on primary)
 *   --md-sys-color-on-surface      → #ffffff  (text on surface)
 *   --md-sys-color-on-background   → #ffffff  (text on background)
 *   --md-sys-color-outline-variant → rgba(255,255,255,0.12)  (dividers)
 *   --md-sys-color-secondary-text  → rgba(255,255,255,0.5)   (subtle text)
 * ──────────────────────────────────────────────────────────────────────────── */
:root {
  /* Game Gizmo raw design tokens */
  --gg-color-background: #1a1a1a;
  --gg-color-surface: #2a2a2a;
  --gg-color-primary: #ffde59;
  --gg-color-on-surface: #ffffff;
  --gg-color-subtle: rgba(255, 255, 255, 0.5);

  /* Material 3 system colour roles mapped to Game Gizmo values */
  --md-sys-color-background: #1a1a1a;
  --md-sys-color-on-background: #ffffff;
  --md-sys-color-surface: #2a2a2a;
  --md-sys-color-on-surface: #ffffff;
  --md-sys-color-surface-variant: #3a3a3a;
  --md-sys-color-on-surface-variant: rgba(255, 255, 255, 0.7);
  --md-sys-color-primary: #ffde59;
  --md-sys-color-on-primary: #1a1a1a;
  --md-sys-color-primary-container: #4a3d00;
  --md-sys-color-on-primary-container: #ffde59;
  --md-sys-color-secondary: rgba(255, 255, 255, 0.7);
  --md-sys-color-on-secondary: #1a1a1a;
  --md-sys-color-error: #f28b82;
  --md-sys-color-on-error: #1a1a1a;
  --md-sys-color-outline: rgba(255, 255, 255, 0.3);
  --md-sys-color-outline-variant: rgba(255, 255, 255, 0.12);
  --md-sys-color-inverse-surface: #ffffff;
  --md-sys-color-inverse-on-surface: #1a1a1a;
  --md-sys-color-inverse-primary: #1a1a1a;

  /* Material 3 typography — override to use Kanit */
  --md-sys-typescale-display-font: "Kanit", sans-serif;
  --md-sys-typescale-headline-font: "Kanit", sans-serif;
  --md-sys-typescale-title-font: "Kanit", sans-serif;
  --md-sys-typescale-body-font: "Kanit", sans-serif;
  --md-sys-typescale-label-font: "Kanit", sans-serif;

  /* Material Web component tokens */
  --md-filled-button-container-color: var(--gg-color-primary);
  --md-filled-button-label-text-color: #1a1a1a;
  --md-filled-button-label-text-font: "Kanit", sans-serif;
  --md-filled-button-label-text-weight: 700;
  --md-filled-button-container-height: 48px;
  --md-filled-button-container-shape: 8px;

  --md-outlined-button-outline-color: var(--gg-color-primary);
  --md-outlined-button-label-text-color: var(--gg-color-primary);
  --md-outlined-button-label-text-font: "Kanit", sans-serif;

  --md-text-button-label-text-color: var(--gg-color-primary);
  --md-text-button-label-text-font: "Kanit", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background: var(--gg-color-background);
  color: var(--gg-color-on-surface);
  font-family: "Kanit", sans-serif;
  font-weight: 400;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--gg-color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ─── Layout Helpers ─────────────────────────────────────────────────────── */
.gg-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Navigation ──────────────────────────────────────────────────────────── */
.gg-nav {
  display: flex;
  align-items: center;
  padding: 20px 0;
}

.gg-nav__wordmark {
  font-size: 20px;
  font-weight: 700;
  color: var(--gg-color-on-surface);
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
}

.gg-nav__wordmark:hover {
  text-decoration: none;
  color: var(--gg-color-primary);
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */
.gg-footer {
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding: 32px 0;
  margin-top: 40px;
  color: var(--gg-color-subtle);
  font-size: 14px;
}

.gg-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin-bottom: 16px;
}

.gg-footer__links a {
  color: var(--gg-color-subtle);
  font-size: 14px;
}

.gg-footer__links a:hover {
  color: var(--gg-color-on-surface);
}

.gg-footer__copy {
  color: var(--gg-color-subtle);
  font-size: 13px;
}

/* ─── Typography Utilities ───────────────────────────────────────────────── */
.gg-text-primary {
  color: var(--gg-color-primary);
}

.gg-text-subtle {
  color: var(--gg-color-subtle);
}

/* ─── Status Indicator ───────────────────────────────────────────────────── */
.gg-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gg-color-subtle);
}

.gg-status__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.gg-status--ok .gg-status__dot {
  background: #4caf50;
  box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}

.gg-status--degraded .gg-status__dot {
  background: #ffb300;
  box-shadow: 0 0 6px rgba(255, 179, 0, 0.6);
}

.gg-status--unavailable .gg-status__dot {
  background: #f44336;
  box-shadow: 0 0 6px rgba(244, 67, 54, 0.6);
}

.gg-status--loading .gg-status__dot {
  background: var(--gg-color-subtle);
  animation: gg-pulse 1.4s ease-in-out infinite;
}

@keyframes gg-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}
