/* ============================================================
   TaScan Live Event — Shared Design System
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Space+Mono:wght@400;700&display=swap');

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

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:         #0a0a0f;
  --surface:    #12121a;
  --surface-2:  #1a1a25;
  --surface-3:  #222233;

  /* Accent */
  --accent:     #00e5a0;
  --accent-dim: rgba(0, 229, 160, 0.15);
  --accent-glow: rgba(0, 229, 160, 0.25);

  /* Purple (brand) */
  --purple:     #b482ff;
  --purple-dim: rgba(180, 130, 255, 0.15);

  /* Status */
  --warning:    #ffb340;
  --danger:     #ff4d6a;
  --warning-dim: rgba(255, 179, 64, 0.15);
  --danger-dim:  rgba(255, 77, 106, 0.15);

  /* Text */
  --text:       #e8e8f0;
  --text-dim:   #8888a0;
  --text-muted: #6a6a82;

  /* Border / Radius */
  --border:     #2a2a3a;
  --border-light: #333348;
  --radius:     16px;
  --radius-sm:  10px;
  --radius-xs:  6px;

  /* Typography */
  --font-body:    'DM Sans', system-ui, -apple-system, sans-serif;
  --font-mono:    'Space Mono', 'Courier New', monospace;

  /* Transitions */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:   cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Brand Colors ─────────────────────────────────────── */
.brand-t { color: var(--accent); }
.brand-a { color: var(--purple); }

/* ─── Base Body ─────────────────────────────────────────── */
html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ─── Screen System ─────────────────────────────────────── */
.screen {
  display: none;
  min-height: 100dvh;
  flex-direction: column;
  animation: screenIn 0.35s var(--ease-out) forwards;
}

.screen.active {
  display: flex;
}

@keyframes screenIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: none;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover:not(:disabled) {
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.97);
  box-shadow: none;
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-light);
  background: var(--surface-2);
}

.btn-secondary:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── Inputs ─────────────────────────────────────────────── */
.input-field {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}

.input-field::placeholder {
  color: var(--text-muted);
}

.input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

/* ─── Badges ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-photo {
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 160, 0.3);
}

.badge-safety {
  background: var(--warning-dim);
  color: var(--warning);
  border: 1px solid rgba(255, 179, 64, 0.3);
}

/* ─── Connection Badge ───────────────────────────────────── */
.conn-badge {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 1000;
  padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  pointer-events: none;
  transition: background 0.3s, color 0.3s;
}

.conn-badge.online {
  background: rgba(0, 229, 160, 0.15);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 160, 0.3);
}

.conn-badge.offline {
  background: rgba(255, 77, 106, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 77, 106, 0.3);
}

.conn-badge.syncing {
  background: rgba(255, 179, 64, 0.15);
  color: var(--warning);
  border: 1px solid rgba(255, 179, 64, 0.3);
}

/* Default (no class) = online */
.conn-badge:not(.offline):not(.syncing) {
  background: rgba(0, 229, 160, 0.15);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 160, 0.3);
}

/* ─── Photo Modal ────────────────────────────────────────── */
.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}

.photo-modal.active {
  opacity: 1;
  pointer-events: all;
}

.photo-modal img {
  max-width: 100%;
  max-height: 75dvh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.photo-modal .modal-caption {
  margin-top: 14px;
  font-size: 14px;
  color: var(--text-dim);
  text-align: center;
  max-width: 320px;
}

.photo-modal .modal-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
}

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

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

/* ─── Toast Notifications ────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  align-items: center;
  pointer-events: none;
  width: calc(100% - 32px);
  max-width: 360px;
}

.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  animation: toastIn 0.3s var(--ease-spring) forwards;
  pointer-events: none;
  width: 100%;
}

.toast.success {
  background: var(--accent);
  color: #000;
}

.toast.error {
  background: var(--danger);
  color: #fff;
}

.toast.info {
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border);
}

.toast.fade-out {
  animation: toastOut 0.3s var(--ease) forwards;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.95); }
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (min-width: 480px) {
  .btn-primary,
  .btn-secondary {
    font-size: 16px;
    padding: 15px 32px;
  }
}

@media (min-width: 768px) {
  :root {
    --radius: 20px;
  }
}
