/* ============================================================
   LUMIRA '26 — Premium Black & Gold Theme
   ============================================================ */
:root {
  --gold: #d4af37;
  --gold-light: #f0d47a;
  --gold-deep: #b8860b;
  --black: #0a0a0a;
  --black-2: #141414;
  --black-3: #1c1c1c;
  --card: #181818;
  --line: rgba(212, 175, 55, 0.25);
  --glass: rgba(24, 24, 24, 0.72);
  --text: #f5efe0;
  --text-dim: #a89f8a;
  --green: #2ecc71;
  --red: #e74c3c;
  --amber: #f1c40f;
  --font: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

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

body {
  font-family: var(--font);
  color: var(--text);
  min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(212,175,55,0.14), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(212,175,55,0.08), transparent 60%),
    linear-gradient(160deg, #0a0a0a 0%, #050505 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Animated gold particles background */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.particle {
  position: absolute;
  bottom: -12px;
  width: 3px; height: 3px;
  background: var(--gold);
  border-radius: 50%;
  opacity: 0;
  animation: rise linear infinite;
  filter: drop-shadow(0 0 4px var(--gold));
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-100vh) translateX(30px); opacity: 0; }
}

::selection { background: var(--gold); color: #000; }

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

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 8px;
}
.brand { font-size: 1.7rem; font-weight: 800; letter-spacing: 2px; }
.brand em {
  font-style: normal;
  background: linear-gradient(120deg, var(--gold-light), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand small {
  display: block;
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 4px;
  color: var(--text-dim);
  margin-top: 2px;
}
.navlinks a {
  color: var(--text-dim);
  padding: 8px 14px;
  border-radius: 8px;
  transition: 0.25s;
  font-size: 0.92rem;
}
.navlinks a:hover, .navlinks a.active { color: var(--gold); background: rgba(212,175,55,0.08); }

/* ---------- Cards ---------- */
.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.04);
}
.card h2 {
  font-size: 1.35rem;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.card .sub { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 20px; }
.goldpill {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: rgba(212,175,55,0.1);
  color: var(--gold);
  font-size: 0.7rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border: none;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
  color: #120d00;
  box-shadow: 0 8px 24px rgba(212,175,55,0.25);
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(212,175,55,0.35);
  filter: brightness(1.05);
}
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.outline {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn.outline:hover { background: rgba(212,175,55,0.1); }
.btn.small { padding: 8px 14px; font-size: 0.82rem; }
.btn.block { width: 100%; }
.btn.danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(231,76,60,0.5);
  box-shadow: none;
}
.btn.danger:hover {
  background: rgba(231,76,60,0.12);
  box-shadow: none;
  filter: none;
}

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.82rem;
  letter-spacing: 1px;
  color: var(--text-dim);
  text-transform: uppercase;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(10,10,10,0.5);
  color: var(--text);
  font-size: 0.98rem;
  font-family: var(--font);
  transition: 0.25s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.18);
}
.field input::placeholder { color: #5a5447; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- Ticket ---------- */
.ticket-wrap { margin-top: 34px; text-align: center; }
.ticket {
  position: relative;
  display: inline-block;
  text-align: left;
  width: 420px;
  max-width: 100%;
  background: linear-gradient(155deg, #202020 0%, #0d0d0d 70%);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  margin: 6px auto;
  box-shadow: 0 30px 90px rgba(0,0,0,0.8), 0 0 0 4px rgba(212,175,55,0.08);
  animation: fadeUp 0.6s ease both;
}
.ticket::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(212,175,55,0.22), transparent 45%),
    radial-gradient(circle at 90% 100%, rgba(212,175,55,0.15), transparent 50%);
  pointer-events: none;
}
.ticket-head {
  padding: 22px 24px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px dashed var(--line);
}
.ticket-brand { font-weight: 800; font-size: 1.5rem; letter-spacing: 3px; }
.ticket-brand em {
  font-style: normal;
  background: linear-gradient(120deg, var(--gold-light), var(--gold-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.ticket-brand small { display: block; font-size: 0.58rem; letter-spacing: 3px; color: var(--text-dim); font-weight: 400; }
.ticket-body { padding: 18px 24px; display: flex; gap: 18px; align-items: center; }
.qr {
  background: #ffffff;
  padding: 10px;
  border-radius: 12px;
  width: 150px; height: 150px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.qr img, .qr canvas, .qr svg { width: 100%; height: 100%; display: block; border-radius: 4px; }
.ticket-detail { flex: 1; min-width: 0; }
.tgline { margin-bottom: 9px; }
.tgline .k { font-size: 0.6rem; letter-spacing: 2px; color: var(--text-dim); text-transform: uppercase; }
.tgline .v { font-size: 1rem; font-weight: 700; color: #fff; word-break: break-word; }
.ticket-id {
  display: inline-block;
  margin-top: 4px;
  font-family: Consolas, monospace;
  font-size: 0.82rem;
  letter-spacing: 1px;
  color: var(--gold);
  background: rgba(212,175,55,0.1);
  border: 1px solid var(--line);
  padding: 4px 10px;
  border-radius: 6px;
}
.ticket-foot {
  padding: 12px 24px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: var(--text-dim);
  border-top: 1px dashed var(--line);
}
.status-chip { font-size: 0.62rem; letter-spacing: 2px; padding: 5px 12px; border-radius: 20px; font-weight: 700; }
.status-active { background: rgba(46,204,113,0.15); color: var(--green); border: 1px solid rgba(46,204,113,0.4); }
.status-scanned { background: rgba(231,76,60,0.15); color: var(--red); border: 1px solid rgba(231,76,60,0.4); }

/* Perforation side notches */
.ticket { position: relative; }
.ticket::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -10px;
  transform: translateX(-50%);
  width: 220px; height: 20px;
  background: radial-gradient(circle at 0 50%, rgba(212,175,55,0.6) 3px, transparent 3.5px) repeat-x;
  background-size: 12px 20px;
  opacity: 0.5;
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
.animate-in { animation: fadeUp 0.55s ease both; }
.dim { color: var(--text-dim); }

/* ---------- Toast ---------- */
.toast-zone { position: fixed; bottom: 24px; right: 24px; z-index: 999; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  padding: 13px 18px;
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0,0,0,0.6);
  font-size: 0.92rem;
  animation: fadeUp 0.35s ease both;
  max-width: 340px;
}
.toast.good { border-left-color: var(--green); }
.toast.bad { border-left-color: var(--red); }

/* ---------- Empty / loading ---------- */
.empty { text-align: center; padding: 50px 20px; color: var(--text-dim); }
.empty .big { font-size: 3rem; }
.spinner {
  width: 34px; height: 34px;
  border: 3px solid rgba(212,175,55,0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 20px auto;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.centerbox { text-align: center; }

/* ---------- Admin table ---------- */
.adminbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.counts { display: flex; gap: 14px; }
.counts div {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(212,175,55,0.06);
  text-align: center;
}
.counts b { display: block; font-size: 1.4rem; color: var(--gold); }
.counts span { font-size: 0.65rem; letter-spacing: 1px; text-transform: uppercase; color: var(--text-dim); }
.searchbox input {
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(10,10,10,0.5);
  color: var(--text);
  width: 230px;
}
.tablewrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th, .table td { padding: 13px 14px; text-align: left; border-bottom: 1px solid rgba(212,175,55,0.12); font-size: 0.9rem; }
.table th { color: var(--gold); text-transform: uppercase; letter-spacing: 1px; font-size: 0.72rem; }
.table tbody tr { transition: 0.2s; }
.table tbody tr:hover { background: rgba(212,175,55,0.05); }
.table code { font-family: Consolas, monospace; color: var(--gold); }

/* ---------- Scanner modal ---------- */
.modal-ov {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-ov.open { display: flex; animation: fadeIn 0.3s ease; }
.modal {
  background: linear-gradient(160deg, #1a1a1a, #0a0a0a);
  border: 1px solid var(--line);
  border-radius: 20px;
  width: 420px;
  max-width: 100%;
  padding: 26px;
  box-shadow: 0 30px 90px rgba(0,0,0,0.9);
  position: relative;
}
.modal h3 { margin-bottom: 6px; letter-spacing: 1px; }
.modal .close { position: absolute; top: 14px; right: 16px; font-size: 1.4rem; cursor: pointer; color: var(--text-dim); background: none; border: none; }
.modal .close:hover { color: var(--gold); }
#scannerBox { width: 100%; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #000; }
#scannerBox video { width: 100%; display: block; }
#scanResult { margin-top: 16px; }

/* ---------- Ticket popup modal ---------- */
.modal.ticket-modal { width: 520px; text-align: center; }
.modal.ticket-modal .ticket { margin: 18px auto 0; width: 100%; display: block; }
.modal.ticket-modal .dim { margin-top: 4px; }
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .row2 { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; text-align: center; }
  .card { padding: 20px; }
  .counts { width: 100%; justify-content: space-between; }
  .counts div { flex: 1; }
  .searchbox input { width: 100%; }
  .adminbar { flex-direction: column; align-items: stretch; }

  /* Ticket popup modal — mobile friendly */
  .modal-ov { padding: 12px; align-items: flex-start; overflow-y: auto; }
  .modal { padding: 18px; border-radius: 16px; }
  .modal.ticket-modal { width: 100%; max-width: 440px; margin: 0 auto; }
  .modal .close { top: 8px; right: 10px; font-size: 1.2rem; }
  .modal h3 { font-size: 1.05rem; }
  .modal.ticket-modal .ticket { margin: 16px auto 0; }

  .ticket-head { padding: 16px 16px 12px; }
  .ticket-body { flex-direction: column; gap: 14px; padding: 16px; text-align: center; }
  .ticket-detail { width: 100%; }
  .qr { width: 150px; height: 150px; }
  .ticket-foot { padding: 10px 16px 14px; font-size: 0.55rem; gap: 8px; }
  .ticket-brand { font-size: 1.25rem; }
  .ticket-brand small { font-size: 0.52rem; letter-spacing: 2px; }
  .tgline .k { font-size: 0.52rem; }
  .tgline .v { font-size: 0.9rem; }
  .ticket-id { font-size: 0.72rem; }

  .modal.ticket-modal .ticket::after { display: none; }

  .modal-actions { margin-top: 18px; display: grid; grid-template-columns: 1fr; width: 100%; }
  .modal-actions .btn { width: 100%; }

  #scannerBox video { border-radius: 12px; }
}

@media (max-width: 380px) {
  .qr { width: 128px; height: 128px; }
  .ticket-body { gap: 12px; }
}
