/* =========================================================
   design-system.css — TriviaGames Player UI
   Modern Arcade / Synthwave + Corporate Dark Mode
   ========================================================= */

/* Google Fonts — Inter */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ── */
:root {
  /* Backgrounds */
  --bg-base:       #0b0c10;
  --bg-card:       rgba(15, 23, 42, 0.6);   /* slate-900 / 60% */
  --bg-card-solid: #0f172a;
  --bg-overlay:    rgba(11, 12, 16, 0.85);

  /* Accent Colors */
  --cyan-400:    #22d3ee;
  --cyan-500:    #06b6d4;
  --fuchsia-400: #e879f9;
  --fuchsia-500: #d946ef;
  --emerald-400: #34d399;
  --emerald-500: #10b981;
  --red-500:     #ef4444;
  --orange-500:  #f97316;
  --amber-400:   #fbbf24;

  /* Text */
  --text-primary:   #f1f5f9;  /* slate-100 */
  --text-secondary: #cbd5e1;  /* slate-300 */
  --text-muted:     #94a3b8;  /* slate-400 */

  /* Borders */
  --border-subtle: rgba(51, 65, 85, 0.6);  /* slate-700 / 60% */
  --border-accent: rgba(34, 211, 238, 0.3);

  /* Glow */
  --glow-cyan:    0 0 20px rgba(34, 211, 238, 0.25);
  --glow-fuchsia: 0 0 20px rgba(232, 121, 249, 0.25);

  /* Spacing */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;

  /* Transitions */
  --transition: all 0.2s ease;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Animated background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── Glass Card ── */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.glass-card--glow {
  box-shadow: var(--glow-cyan);
  border-color: var(--border-accent);
}

/* ── Gradient top border (modal/special cards) ── */
.gradient-top-border {
  position: relative;
  overflow: hidden;
}
.gradient-top-border::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--cyan-500), var(--fuchsia-500));
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover  { transform: scale(1.05); }
.btn:active { transform: scale(0.95); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--cyan-500);
  color: #0b0c10;
  box-shadow: 0 0 15px rgba(34, 211, 238, 0.3);
}
.btn-primary:hover { background: var(--cyan-400); box-shadow: 0 0 25px rgba(34, 211, 238, 0.5); }

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.btn-secondary:hover { color: var(--text-primary); border-color: var(--cyan-500); }

.btn-danger {
  background: var(--red-500);
  color: #fff;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-md); }
.btn-full { width: 100%; }

/* ── Status Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-emerald { background: rgba(6, 78, 59, 0.5); color: var(--emerald-400); border: 1px solid rgba(52, 211, 153, 0.3); }
.badge-red     { background: rgba(127, 29, 29, 0.5); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-amber   { background: rgba(120, 53, 15, 0.5); color: var(--amber-400); border: 1px solid rgba(251, 191, 36, 0.3); }
.badge-cyan    { background: rgba(8, 51, 68, 0.5); color: var(--cyan-400); border: 1px solid rgba(34, 211, 238, 0.3); }

/* ── Typography helpers ── */
.text-gradient {
  background: linear-gradient(135deg, var(--cyan-400), var(--fuchsia-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mono { font-family: var(--font-mono); }

/* ── Input ── */
.input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}
.input:focus { border-color: var(--cyan-500); box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15); }
.input::placeholder { color: var(--text-muted); }

/* ── Alert / Error banner ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  display: none;
}
.alert.show { display: block; }
.alert-error { background: rgba(127, 29, 29, 0.4); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; }
.alert-success { background: rgba(6, 78, 59, 0.4); border: 1px solid rgba(52, 211, 153, 0.4); color: #6ee7b7; }

/* ── Pulse animation ── */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
.pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* ── Spin animation ── */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin { animation: spin 1s linear infinite; }

/* ── Slide-in from bottom ── */
@keyframes slideInUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}
.slide-in-up { animation: slideInUp 0.5s ease forwards; }

/* ── Glow text ── */
.glow-cyan    { text-shadow: 0 0 20px rgba(34, 211, 238, 0.6); }
.glow-fuchsia { text-shadow: 0 0 20px rgba(232, 121, 249, 0.6); }

/* ── Layout helpers ── */
.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}
.flex-center { display: flex; align-items: center; justify-content: center; }
.full-page   { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }

/* ═══════════════════════════════════════════════════════
   Company Admin System — Extended Styles
   ═══════════════════════════════════════════════════════ */

/* ── Top Navigation ── */
.topnav {
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topnav__brand {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.topnav__links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.topnav__link {
  display: inline-block;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

.topnav__link:hover,
.topnav__link--active {
  color: var(--text-primary);
  background: rgba(51, 65, 85, 0.4);
}

.topnav__link--accent {
  background: rgba(6, 182, 212, 0.15);
  color: var(--cyan-400);
  border: 1px solid rgba(34, 211, 238, 0.3);
}

.topnav__link--accent:hover {
  background: rgba(6, 182, 212, 0.25);
}

.topnav__link--fuchsia {
  background: rgba(217, 70, 239, 0.15);
  color: var(--fuchsia-400);
  border: 1px solid rgba(232, 121, 249, 0.3);
}

.topnav__link--fuchsia:hover {
  background: rgba(217, 70, 239, 0.28);
  color: var(--fuchsia-400);
}

.topnav__right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

.topnav__user {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topnav__logout {
  padding: 5px 12px;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.topnav__logout:hover {
  color: var(--text-primary);
  border-color: rgba(148,163,184,0.5);
  background: rgba(51,65,85,0.35);
}

.topnav__live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan-400);
  margin-right: 5px;
  vertical-align: middle;
  position: relative;
  top: -1px;
  box-shadow: 0 0 0 0 rgba(34,211,238,0.5);
  animation: nav-pulse 2s ease-in-out infinite;
}

@keyframes nav-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(34,211,238,0.5); }
  50%  { box-shadow: 0 0 0 4px rgba(34,211,238,0);   }
  100% { box-shadow: 0 0 0 0   rgba(34,211,238,0);   }
}

/* ── Page Layout ── */
.admin-layout {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-body {
  flex: 1;
  padding: 32px 24px 64px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ── Page Header ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-widget {
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-widget__label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.stat-widget__value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--cyan-400);
  line-height: 1;
  letter-spacing: -0.03em;
}

.stat-widget__sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 24px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(51, 65, 85, 0.2);
}

.tab-btn--active {
  color: var(--cyan-400);
  border-bottom-color: var(--cyan-500);
  background: rgba(6, 182, 212, 0.08);
}

.tab-panel { display: none; }
.tab-panel--active { display: block; }

/* ── Table ── */
.tbl-wrap {
  overflow: hidden;
}

.tbl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.tbl-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
}

.tbl-th {
  padding: 10px 16px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.3);
}

.tbl-row {
  border-bottom: 1px solid rgba(51, 65, 85, 0.4);
  transition: background 0.15s ease;
}

.tbl-row:last-child { border-bottom: none; }
.tbl-row:hover { background: rgba(51, 65, 85, 0.2); }

.tbl-cell {
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  vertical-align: middle;
}

.tbl-cell--actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.tbl-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ── Buttons (extra) ── */
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--cyan-500);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 12, 16, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  display: none;
}

.modal-overlay.show { display: flex; }

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}

.modal__title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal__close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: var(--transition);
}

.modal__close:hover { color: var(--red-500); }

.modal__body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

.modal__footer {
  padding: 16px 24px 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid var(--border-subtle);
}

/* ── Form ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.form-error {
  font-size: 0.75rem;
  color: #fca5a5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

textarea.input {
  resize: vertical;
  min-height: 80px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--cyan-500);
  cursor: pointer;
}

/* ── Section Card ── */
.section-card {
  margin-bottom: 24px;
}

/* ── License / Info card ── */
.info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.info-row:last-child { border-bottom: none; }

.info-row__key {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 180px;
}

.info-row__val {
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-align: right;
  word-break: break-all;
}

/* ── AI placeholder ── */
.ai-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 32px;
  text-align: center;
  gap: 20px;
}

.ai-placeholder__icon {
  font-size: 4rem;
  line-height: 1;
  filter: grayscale(60%);
  opacity: 0.5;
}

.ai-placeholder__title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ai-placeholder__desc {
  max-width: 400px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Question form option rows ── */
.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.option-row__letter {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--cyan-400);
  min-width: 24px;
  font-size: 0.9rem;
}

.option-row__correct {
  width: 18px;
  height: 18px;
  accent-color: var(--emerald-500);
  cursor: pointer;
  flex-shrink: 0;
}

.option-row__remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 4px;
  transition: var(--transition);
  flex-shrink: 0;
}

.option-row__remove:hover { color: var(--red-500); }

/* ── Glow Background ── */
.glow-bg {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  filter: blur(80px);
}

.glow-bg--cyan {
  background: radial-gradient(circle, rgba(34, 211, 238, 0.06) 0%, transparent 70%);
  width: 600px;
  height: 600px;
  top: -100px;
  left: -150px;
}

.glow-bg--fuchsia {
  background: radial-gradient(circle, rgba(232, 121, 249, 0.05) 0%, transparent 70%);
  width: 500px;
  height: 500px;
  bottom: -100px;
  right: -100px;
}

/* ── Custom Scrollbar ── */
::-webkit-scrollbar        { width: 4px; height: 4px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: rgba(34,211,238,.25); border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(34,211,238,.5); }
* { scrollbar-width: thin; scrollbar-color: rgba(34,211,238,.25) transparent; }
