:root {
  --bg: #0f172a;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --shadow: 0 8px 24px rgba(2, 8, 23, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: url('public/assets/f01.png') no-repeat center center fixed;
  background-size: cover;
}

/* Hero */
.hero {
  padding: 48px 20px;
  background: linear-gradient(180deg, rgba(14,165,233,0.15), rgba(14,165,233,0) 60%);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.hero__content {
  max-width: 950px;
  margin: 0 auto;
  color: #e5e7eb;
}
.hero h1 {
  margin: 0 0 6px 0;
  font-size: 32px;
  color: #ffffff;
}
.subtitle {
  margin: 0;
  font-size: 18px;
  color: #cbd5e1;
}

/* Layout */
.container {
  max-width: 950px;
  margin: 24px auto;
  padding: 0 20px;
}
.card {
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}

/* Forms */
.form-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
label span {
  display: inline-block;
  min-width: 80px;
  color: var(--muted);
}
input,
select,
button {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 0.95em;
}
input,
select {
  flex: 1 1 240px;
}
button {
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}
button:hover {
  background: var(--primary-dark);
}
button:active {
  transform: translateY(1px);
}
.hint {
  color: var(--muted);
  margin-top: 8px;
}

/* Section header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.actions a {
  color: var(--primary-dark);
  text-decoration: none;
}
.actions a:hover {
  text-decoration: underline;
}

/* Code block */
.code {
  background: #0f172a;
  color: #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

/* Badges */
.badge {
  padding: 4px 8px;
  border-radius: 16px;
  color: #fff;
  font-weight: 600;
  font-size: 0.78em;
}
.b-blue { background-color: #0ea5e9; }
.b-yellow { background-color: #f59e0b; color: #000; }
.b-red { background-color: #ef4444; }
.b-purple { background-color: #8b5cf6; }

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 10px;
  overflow: hidden;
}
thead th {
  background: #f3f4f6;
  color: #111827;
  font-weight: 600;
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}
tbody td {
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
}
tbody tr:hover {
  background: #f9fafb;
}

.muted { color: var(--muted); }
.hidden { display: none; }

/* Meta grid */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.meta-item {
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 12px;
  background: #fcfdff;
}
.meta-label {
  color: var(--muted);
  font-size: 0.85em;
  margin-bottom: 4px;
}
.meta-value {
  font-weight: 600;
}

/* Footer */
.footer {
  color: #93c5fd;
  text-align: center;
  padding: 24px 20px 40px;
  font-size: 0.9em;
}

/* Footer logo */
.footer-logo {
  margin-top: 12px;
  text-align: center;
}
.footer-logo img {
  height: 50px;
  width: auto;
  display: inline-block;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .container {
    max-width: 100%;
    padding: 0 10px;
  }

  .card {
    padding: 10px;
    margin-bottom: 10px;
  }

  .hero h1 { font-size: 20px; }
  .subtitle { font-size: 13px; }

  /* Compact input layout */
  .form-row {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  input,
  select,
  button {
    width: 100%;
    padding: 4px 6px;
    font-size: 0.85em;
  }

  label span {
    min-width: auto;
  }

  .meta-item {
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
    font-size: 0.85em;
  }
  .meta-label {
    flex: 1;
    font-weight: 500;
  }
  .meta-value {
    flex: 1;
    text-align: right;
  }

  #jsonOut {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.8em;
  }

  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
  }

  th,
  td {
    white-space: nowrap;
    padding: 4px 6px;
  }

  #eventsTable {
    font-size: 0.8em;
  }

  .footer-logo img {
    height: 30px;
    width: auto;
  }
}

/* ----------------------------------- */
/* Performance Overview styling */
/* ----------------------------------- */

.performance-overview {
  margin-top: 24px;
}

.graph-wrapper {
  width: 100%;
  height: 320px;
  margin: 20px 0;
  position: relative;
}

/* ----------------------------------- */
/* Small loading popup (no screen freeze) */
/* ----------------------------------- */

.modal {
  position: fixed;
  top: 16px;               /* change to bottom:16px if you prefer */
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: rgba(15, 23, 42, 0.96);
  color: #e5e7eb;
  font-size: 0.9rem;
  border-radius: 999px;     /* pill shape */
  box-shadow: var(--shadow);
  z-index: 9999;
  pointer-events: none;     /* clicks still go to the page */
}

.modal.hidden {
  display: none;
}
