/*
  Kiosk Admin — Premium FX Skin (v1)
  Goals:
  - Match the menu's premium sci-fi material language
  - Unified pointer light model via CSS vars (--light-x/--light-y)
  - Calmer, admin-appropriate motion (no canvas / particles)
  - Keep existing class names so pages don't break
*/

:root {
  /* Core palette (aligned with menu) */
  --bg-dark: #050a14;
  --bg-mid: #0f172a;

  --cyan: #00d4ff;
  --cyan-bright: #00f3ff;
  --cyan-glow: rgba(0, 212, 255, 0.45);

  --teal: #0d9488;
  --teal-glow: rgba(20, 184, 166, 0.35);

  --gold: #ffd700;
  --green: #22c55e;
  --red: #ff3366;
  --purple: #a855f7;

  --text-primary: #f8fafc;
  --text-muted: #94a3b8;

  --border-subtle: rgba(148, 163, 184, 0.14);
  --panel-border: rgba(0, 243, 255, 0.28);

  /* Keep legacy variables used inline in pages */
  --panel-bg: rgba(15, 23, 42, 0.78);

  /* Pointer light (set by fx-lite.js) */
  --mx: 0.5;
  --my: 0.5;
  --light-x: 50%;
  --light-y: 50%;

  /* Material controls */
  --specular: 0.16;
  --rim: 0.10;

  /* Radii */
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 20px;

  /* Motion */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Space Background (calmer, less "game") */
.space-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 120% 80% at 80% 20%, var(--cyan-glow), transparent 55%),
    radial-gradient(ellipse 100% 70% at 18% 80%, var(--teal-glow), transparent 60%),
    radial-gradient(ellipse at center, #0a1628 0%, #050a14 70%);
  overflow: hidden;
}

/* Keep stars, but quieter */
.stars {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.85), transparent),
    radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.75), transparent);
  background-size: 240px 240px;
  animation: stars 140s linear infinite;
}

@keyframes stars {
  from { transform: translateY(0); }
  to { transform: translateY(-240px); }
}

.nebula {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.25;
}

.nebula-1 {
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, rgba(0,243,255,0.24), transparent 60%);
  top: -260px;
  right: -260px;
  animation: float 28s ease-in-out infinite;
}

.nebula-2 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(168,85,247,0.22), transparent 60%);
  bottom: -220px;
  left: -220px;
  animation: float 34s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(26px, 18px); }
}

/* Header */
.command-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(180deg, rgba(5,10,20,0.96), rgba(15,23,42,0.82) 70%, transparent);
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.logo-section { display: flex; align-items: center; gap: 16px; }
.logo-icon { font-size: 28px; color: var(--cyan-bright); filter: drop-shadow(0 0 10px rgba(0,243,255,0.45)); }
.system-title {
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  font-size: 14px;
  font-weight: 800;
  color: #7dd3fc;
  letter-spacing: 0.18em;
}

.status-indicators { display: flex; align-items: center; gap: 14px; }

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(148,163,184,0.22);
  border-radius: 999px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: transform 0.25s var(--ease-out-expo), border-color 0.25s ease, box-shadow 0.25s ease;
}

.user-badge:hover {
  border-color: rgba(0,243,255,0.45);
  box-shadow: 0 0 24px rgba(0,212,255,0.10);
  transform: translateY(-1px);
}

/* Buttons */
.btn {
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.22s var(--ease-out-expo), border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
  border: 1px solid;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.btn-primary {
  background: rgba(0, 212, 255, 0.14);
  border-color: rgba(0, 243, 255, 0.42);
  color: var(--cyan-bright);
  box-shadow: 0 0 0 1px rgba(0, 243, 255, 0.10), 0 0 28px rgba(0, 212, 255, 0.10);
}

.btn-secondary {
  background: rgba(15,23,42,0.25);
  border-color: rgba(100,116,139,0.35);
  color: var(--text-muted);
}

.btn-danger {
  background: rgba(255, 51, 102, 0.10);
  border-color: rgba(255, 51, 102, 0.55);
  color: #fecaca;
}

.btn-sm { padding: 6px 12px; font-size: 12px; }

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.99); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Forms */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 11px;
  color: #7dd3fc;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(15,23,42,0.62);
  border: 1px solid rgba(0,243,255,0.24);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: rgba(0,243,255,0.55);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.12);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active { display: flex; }

.modal-content {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  padding: 28px;
  max-width: 540px;
  width: 92%;
  box-shadow: 0 20px 70px rgba(0,0,0,0.6), 0 0 40px rgba(0,212,255,0.12);
  position: relative;
  overflow: hidden;
}

.modal-title {
  font-size: 14px;
  letter-spacing: 0.18em;
  color: #7dd3fc;
  font-weight: 900;
  margin-bottom: 18px;
}

.modal-actions { display: flex; gap: 12px; margin-top: 22px; }
.modal-actions .btn { flex: 1; padding: 12px; }

/* Premium material core (panel, card, nav-card, login-box) */
.panel, .card, .nav-card, .login-box {
  position: relative;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 10px 42px rgba(0,0,0,0.55),
    0 0 36px rgba(0,212,255,0.08),
    inset 0 2px 4px rgba(0,0,0,0.34),
    inset 0 1px 0 rgba(255,255,255,0.10);
}

/* Micro noise + bevel */
.panel::before, .card::before, .nav-card::before, .login-box::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  background:
    repeating-radial-gradient(
      circle at 10% 20%,
      rgba(255,255,255,0.018) 0px,
      rgba(255,255,255,0.018) 1px,
      rgba(0,0,0,0) 2px,
      rgba(0,0,0,0) 4px
    ),
    linear-gradient(
      180deg,
      rgba(255,255,255,0.09) 0%,
      rgba(255,255,255,0.03) 18%,
      rgba(0,0,0,0.00) 55%,
      rgba(0,0,0,0.18) 100%
    );
  mix-blend-mode: overlay;
  opacity: 0.85;
}

/* Pointer specular + rim */
.panel::after, .card::after, .nav-card::after, .login-box::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.28s ease;
  background:
    radial-gradient(
      ellipse 52% 34% at var(--light-x) var(--light-y),
      rgba(255,255,255,var(--specular)) 0%,
      rgba(255,255,255, calc(var(--specular) * 0.45)) 26%,
      rgba(255,255,255, calc(var(--specular) * 0.15)) 42%,
      transparent 72%
    ),
    linear-gradient(
      135deg,
      rgba(0,243,255,var(--rim)) 0%,
      transparent 28%,
      transparent 72%,
      rgba(0,243,255, calc(var(--rim) * 0.75)) 100%
    );
}

.panel:hover::after, .card:hover::after, .nav-card:hover::after, .login-box:hover::after {
  opacity: 1;
}

/* Ensure content sits above the material layers */
.panel > *, .card > *, .nav-card > *, .login-box > * {
  position: relative;
  z-index: 3;
}

.card { padding: 20px; border-radius: 16px; }
.card:hover {
  border-color: rgba(0,243,255,0.45);
  transform: translateY(-2px);
  transition: transform 0.3s var(--ease-out-expo), border-color 0.25s ease, box-shadow 0.25s ease;
}

.panel { padding: 25px; }

/* Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* When FX is toggled off (dev), disable specular/rim */
.fx-off .panel::after,
.fx-off .card::after,
.fx-off .nav-card::after,
.fx-off .login-box::after {
  opacity: 0 !important;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .stars, .nebula-1, .nebula-2 { animation: none !important; }
  .panel, .card, .nav-card, .login-box, .btn, .user-badge { transition: none !important; }
}
