/* public/site.css */
/* StoneParks — Unified Site Styles (Base + Frosted UI) */

/* ---------------------------
   Base / reset
---------------------------- */
:root {
  --sp-bg: #020617;
  --sp-text: #e5e7eb;
  --sp-muted: rgba(226, 232, 240, 0.7);
  --sp-border: rgba(148, 163, 184, 0.18);

  /* Frosted knobs */
  --glass-bg: rgba(2, 8, 23, 0.28);
  --glass-inner: rgba(2, 8, 23, 0.18);
  --glass-border: rgba(148, 163, 184, 0.22);
  --glass-shadow: 0 18px 45px rgba(0, 0, 0, 0.55);
  --glass-blur: 18px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  background: var(--sp-bg);
  color: var(--sp-text);
}

/* ---------------------------
   Background (panther / themes)
   client-theme.js can override via theme CSS
---------------------------- */
.sp-body {
  min-height: 100vh;
  background-color: #020617;
  background-image:
    radial-gradient(1200px 700px at 15% 20%, rgba(16, 185, 129, 0.12), transparent 60%),
    radial-gradient(900px 600px at 70% 35%, rgba(59, 130, 246, 0.12), transparent 62%),
    radial-gradient(1100px 700px at 55% 80%, rgba(234, 179, 8, 0.10), transparent 62%);
  background-attachment: fixed;
  background-size: cover;
  background-position: center;
}

/* Optional: if a theme CSS sets a stronger background image, this still keeps “frosted” readable */
.frosted-log .sp-body,
.sp-body.frosted-log {
  background-blend-mode: screen;
}

/* ---------------------------
   Shell / header
---------------------------- */
.sp-shell {
  min-height: 100vh;
}

.sp-header {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 14px 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(2, 8, 23, 0.55);
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sp-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.sp-brand-mark {
  width: 18px;
  height: 18px;
  display: block;
}

.sp-brand-title {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.sp-brand-subtitle {
  font-size: 12px;
  opacity: 0.75;
  margin-top: 1px;
}

.sp-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(2, 8, 23, 0.45);
  font-size: 13px;
}

/* ---------------------------
   Main layout
---------------------------- */
.sp-main {
  max-width: 1100px;
  margin: 0 auto 72px;
  padding: 24px 16px 0;
}

.center-layout {
  display: flex;
  justify-content: center;
  padding-top: 48px;
}

/* ---------------------------
   Buttons
---------------------------- */
.btn-primary {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #16a34a;
  color: white;
  font-weight: 700;
}

.btn-primary:hover {
  background: #15803d;
}

.btn-secondary {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(2, 8, 23, 0.15);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.12);
}

.btn-ghost {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(2, 8, 23, 0.18);
  color: inherit;
  cursor: pointer;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

.header-btn {
  padding: 8px 14px;
}

/* ---------------------------
   Frosted cards / panels
---------------------------- */
.glass-panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.glass-inner {
  background: var(--glass-inner);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.panel.card {
  padding: 22px 24px;
  margin-top: 20px;
}

.panel-title {
  margin: 0 0 8px;
  font-size: 1.4rem;
  font-weight: 800;
}

.panel-subtitle {
  margin: 0 0 18px;
  color: var(--sp-muted);
}

.panel-footnote {
  margin: 14px 0 0;
  font-size: 13px;
  color: rgba(226, 232, 240, 0.65);
}

.muted {
  color: var(--sp-muted);
}

/* ---------------------------
   Login form (frosted)
---------------------------- */
.form-grid {
  display: grid;
  gap: 12px;
}

.form-field {
  display: grid;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  color: rgba(226, 232, 240, 0.8);
}

.input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 8, 23, 0.25);
  color: #e5e7eb;
  outline: none;
}

.input:focus {
  border-color: rgba(56, 189, 248, 0.55);
}

.full-width {
  width: 100%;
}

.form-error {
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.10);
  color: rgba(254, 202, 202, 0.95);
  font-size: 13px;
}

/* ---------------------------
   Dashboard layout
---------------------------- */
.log-grid {
  display: grid;
  gap: 18px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 12px 0 16px;
}

.stat-card {
  padding: 14px 16px;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.75;
}

.stat-value {
  font-size: 26px;
  font-weight: 900;
  margin-top: 8px;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.filter-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.filter-control select,
.filter-control input {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(2, 8, 23, 0.22);
  color: #e5e7eb;
}

.filter-control.grow {
  flex: 1;
  min-width: 260px;
}

/* ---------------------------
   Tickets table
---------------------------- */
.table-wrap {
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 8, 23, 0.14);
}

.tickets-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.tickets-table th,
.tickets-table td {
  padding: 12px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-size: 13px;
  text-align: left;
}

.tickets-table thead th {
  position: sticky;
  top: 0;
  background: rgba(2, 8, 23, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.9;
}

.link {
  color: rgba(56, 189, 248, 0.95);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

/* ---------------------------
   Modal
---------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.55);
  z-index: 50;
}

.modal-card {
  width: min(700px, 100%);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

/* ---------------------------
   Responsive
---------------------------- */
@media (max-width: 860px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .tickets-table {
    min-width: 720px;
  }
}
