/* =====================================================================
   StoneParks Frosted Theme (SAFE VERSION + RESTORED BOX STYLING)
   - DOES NOT set the background image (theme CSS controls it)
   - Provides overlay mask + true frosted glass + premium structure styling
   ===================================================================== */

/* ---------------------------------------------------------------------
   FROSTED PAGE BASELINE
   --------------------------------------------------------------------- */

body.frosted-log,
body.frosted-pay {
  position: relative;
  z-index: 0;
  min-height: 100vh;
  color: #e5e7eb;
}

/* Light mask ABOVE theme background, BELOW content */
body.frosted-log::before,
body.frosted-pay::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;

  /* Keep readable, let bg show */
  background: radial-gradient(
    circle at top left,
    rgba(15, 23, 42, 0.03) 0,
    rgba(2, 6, 23, 0.10) 45%,
    rgba(0, 0, 0, 0.22) 100%
  );
}

/* Content above mask */
.frosted-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------------
   HEADER (restored structure)
   --------------------------------------------------------------------- */

.sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  position: sticky;
  top: 0;
  z-index: 40;

  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

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

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

.sp-brand-mark {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 12px rgba(250, 250, 250, 0.25));
}

.sp-brand-title {
  font-weight: 650;
  letter-spacing: 0.02em;
}

.sp-brand-subtitle {
  font-size: 12px;
  color: rgba(156, 163, 175, 0.9);
}

.header-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-size: 12px;
  color: #e5e7eb;
}

/* ---------------------------------------------------------------------
   TYPOGRAPHY (bring back "polished" titles)
   --------------------------------------------------------------------- */

body.frosted-log h1,
body.frosted-log h2,
body.frosted-log h3 {
  color: rgba(255, 255, 255, 0.94);
  letter-spacing: 0.01em;
}

body.frosted-log h2 {
  font-size: 20px;
  margin: 0 0 10px 0;
}

.muted {
  color: rgba(148, 163, 184, 0.92);
}

/* ---------------------------------------------------------------------
   BASE COMPONENTS / LAYOUT HELPERS
   --------------------------------------------------------------------- */

.panel {
  padding: 26px 30px; /* slightly roomier again */
}

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

/* Frosted admin log layout */
body.frosted-log .log-grid {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: stretch;
}

body.frosted-log .log-panel-overview,
body.frosted-log .log-panel-tickets {
  width: 100%;
}

/* ---------------------------------------------------------------------
   STATS / FILTERS / TABLE (structure restored)
   --------------------------------------------------------------------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 22px 0 26px;
}

.stat-card {
  padding: 18px 24px;
  border-radius: 999px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(156, 163, 175, 0.95);
}

.stat-value {
  font-size: 26px;
  font-weight: 750;
  color: rgba(255, 255, 255, 0.96);
}

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

.filter-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: rgba(209, 213, 219, 0.95);
}

.filter-search {
  flex: 1 1 260px;
}

/* Buttons */
.btn-ghost {
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    transform 0.08s ease,
    filter 0.15s ease;
}

/* ---------------------------------------------------------------------
   TRUE FROSTED GLASS (keep the improved transparency)
   --------------------------------------------------------------------- */

/* Big panels/cards */
body.frosted-log .card,
body.frosted-log .glass-card,
body.frosted-log .panel,
body.frosted-log .glass-panel {
  background: rgba(255, 255, 255, 0.040) !important; /* tiny bump for legibility */
  backdrop-filter: blur(28px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(140%) !important;

  border: 1px solid rgba(255, 255, 255, 0.16) !important;

  /* Restored “premium box” feel */
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03),
    0 22px 80px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.10) !important;
}

/* Header: glassy but readable */
body.frosted-log .sp-header {
  background: rgba(255, 255, 255, 0.050) !important;
  backdrop-filter: blur(30px) saturate(150%) !important;
  -webkit-backdrop-filter: blur(30px) saturate(150%) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
}

/* Stat pills: glass + glow accents */
body.frosted-log .stat-card {
  background: rgba(255, 255, 255, 0.040) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  backdrop-filter: blur(26px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(26px) saturate(140%) !important;

  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02),
    0 18px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

/* If your HTML already uses these classes, they’ll glow again */
body.frosted-log .stat-card--open {
  box-shadow:
    0 0 0 1px rgba(52, 211, 153, 0.35),
    0 18px 80px rgba(16, 185, 129, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body.frosted-log .stat-card--paid {
  box-shadow:
    0 0 0 1px rgba(59, 130, 246, 0.35),
    0 18px 80px rgba(59, 130, 246, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

body.frosted-log .stat-card--warnings {
  box-shadow:
    0 0 0 1px rgba(250, 204, 21, 0.35),
    0 18px 80px rgba(250, 204, 21, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

/* Inputs + dropdowns: glass, but with stronger outline */
body.frosted-log .filter-control select,
body.frosted-log .filter-control input {
  background: rgba(255, 255, 255, 0.060) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(22px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(140%) !important;
  border-radius: 999px;
  padding: 9px 14px;
}

body.frosted-log .filter-control input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

/* Buttons: keep "ghost" premium look */
body.frosted-log .btn-ghost {
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(22px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(22px) saturate(140%) !important;
}

body.frosted-log .btn-ghost:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Table wrapper: restore rounded + clean header separation */
body.frosted-log .table-wrapper {
  margin-top: 18px;
  border-radius: 20px;
  overflow: hidden;

  background: rgba(255, 255, 255, 0.045) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  backdrop-filter: blur(24px) saturate(140%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(140%) !important;

  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02),
    0 20px 70px rgba(0, 0, 0, 0.45) !important;
}

body.frosted-log .tickets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

body.frosted-log .tickets-table th,
body.frosted-log .tickets-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

/* Table header: clearer + slightly darker than rows for structure */
body.frosted-log .tickets-table th {
  background: rgba(0, 0, 0, 0.18) !important;
  color: rgba(255, 255, 255, 0.88) !important;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* Rows: subtle striping + hover */
body.frosted-log .tickets-table tbody tr:nth-child(odd),
body.frosted-log .tickets-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.020) !important;
}

body.frosted-log .tickets-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.05) !important;
}

/* ---------------------------------------------------------------------
   Responsive tweaks
   --------------------------------------------------------------------- */

@media (max-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.frosted-pay .sp-main,
  body.frosted-log .sp-main {
    padding: 0 20px;
  }
  .panel-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .sp-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  body.frosted-pay .sp-main,
  body.frosted-log .sp-main {
    padding: 0 16px 40px;
  }
}
