/* rust-dvb WASM demo — minimal, no framework */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 1rem 2rem 3rem;
  background: #f8f9fa;
  color: #212529;
  max-width: 1100px;
  margin-inline: auto;
}

header {
  margin-bottom: 1.5rem;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 0.25rem;
}

.subtitle {
  color: #6c757d;
  margin: 0;
}

/* Drop zone */
#dropzone {
  border: 2px dashed #6c757d;
  border-radius: 8px;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
  user-select: none;
  background: #fff;
}

#dropzone.drag-over {
  border-color: #0d6efd;
  background: #e8f0fe;
}

#dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

#dropzone-label {
  pointer-events: none;
  color: #495057;
}

/* Sections */
section {
  margin-top: 1.5rem;
}

h2 {
  font-size: 1.1rem;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Stats */
dl#stats-list {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin: 0;
}

dl#stats-list div {
  display: flex;
  flex-direction: column;
}

dt {
  font-size: 0.75rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

dd {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.9rem;
}

thead th {
  background: #e9ecef;
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
}

tbody tr:nth-child(even) {
  background: #f8f9fa;
}

tbody td {
  padding: 0.4rem 0.75rem;
  vertical-align: top;
  border-top: 1px solid #e9ecef;
}

td.json-cell {
  font-family: monospace;
  font-size: 0.78rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-width: 600px;
}

details summary {
  cursor: pointer;
  color: #0d6efd;
  font-size: 0.82rem;
}

/* Raw JSON */
pre#json-pre {
  background: #212529;
  color: #f8f9fa;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.8rem;
  max-height: 50vh;
}

button#json-toggle {
  font-size: 0.8rem;
  padding: 0.2rem 0.6rem;
  border: 1px solid #0d6efd;
  border-radius: 4px;
  background: transparent;
  color: #0d6efd;
  cursor: pointer;
}

button#json-toggle:hover {
  background: #0d6efd;
  color: #fff;
}

/* Utility */
.hidden {
  display: none !important;
}

#loading {
  margin-top: 1rem;
  color: #0d6efd;
  font-weight: 500;
}

#error-banner {
  margin-top: 1rem;
  background: #f8d7da;
  color: #842029;
  border: 1px solid #f5c2c7;
  border-radius: 6px;
  padding: 0.75rem 1rem;
}
