/* =========================================================================
   CRISP Cam — Functional Styles (Verify Page)
   Used by verify.js for dynamically created elements.
   Design tokens match the Tailwind config in index.html / verify.html.
   ========================================================================= */

:root {
  --bg: #140705;
  --surface: #140705;
  --surface-container-low: #2a1613;
  --surface-container: #2f1a17;
  --surface-container-high: #3a2421;
  --surface-container-highest: #462f2b;
  --primary: #e60000;
  --primary-container: #930100;
  --on-surface: #ffdad4;
  --on-surface-variant: #e9bcb5;
  --outline: #b08781;
  --outline-variant: #5f3f3a;
  --error: #ffb4ab;
  --error-container: #93000a;
  --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
}

/* ── Status bars (set dynamically by verify.js setStatusBar) ────────────── */

.status-bar {
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  font-family: "Space Grotesk", sans-serif;
}

.status-loading {
  background: rgba(230, 0, 0, 0.08);
  border: 1px solid rgba(230, 0, 0, 0.25);
  color: var(--primary);
}

.status-success {
  background: rgba(230, 0, 0, 0.1);
  border: 1px solid rgba(230, 0, 0, 0.4);
  color: var(--primary);
}

.status-error {
  background: rgba(255, 180, 171, 0.08);
  border: 1px solid rgba(255, 180, 171, 0.3);
  color: var(--error);
}

.status-warning {
  background: rgba(209, 59, 43, 0.1);
  border: 1px solid rgba(209, 59, 43, 0.4);
  color: #ffb4a8;
}

.status-info {
  background: rgba(255, 180, 168, 0.08);
  border: 1px solid rgba(255, 180, 168, 0.3);
  color: #ffb4a8;
}

/* ── Detail grid (transaction result rows) ──────────────────────────────── */

.detail-grid {
  display: flex;
  flex-direction: column;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-top: 1rem;
  border: 1px solid rgba(95, 63, 58, 0.15);
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(95, 63, 58, 0.1);
  background: var(--surface-container);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  font-size: 0.75rem;
  color: var(--on-surface-variant);
  min-width: 140px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.detail-value {
  flex: 1;
  font-size: 0.85rem;
  word-break: break-all;
  color: var(--on-surface);
}

/* ── Metadata grid (rendered by verify.js renderMetadataGrid) ───────────── */

.metadata-grid {
  display: grid;
  gap: 1px;
  background: rgba(95, 63, 58, 0.15);
  border-radius: 0.5rem;
  overflow: hidden;
  margin-top: 0.75rem;
}

.meta-row {
  display: grid;
  grid-template-columns: minmax(160px, 30%) 1fr;
  background: var(--surface-container);
}

.meta-key {
  padding: 0.55rem 0.875rem;
  font-size: 0.8rem;
  color: var(--on-surface-variant);
  background: var(--surface-container-high);
}

.meta-value {
  padding: 0.55rem 0.875rem;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--on-surface);
  word-break: break-word;
}

/* ── Recent submissions (rendered by verify.js loadRecent) ──────────────── */

.recent-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  background: var(--surface-container);
  border-bottom: 1px solid rgba(95, 63, 58, 0.1);
  font-size: 0.825rem;
}

.recent-card:last-child {
  border-bottom: none;
}

.recent-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.recent-ts {
  color: var(--on-surface);
}

.recent-file {
  font-size: 0.775rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-hash {
  font-family: var(--font-mono);
  color: var(--primary);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.recent-seq {
  font-size: 0.775rem;
  flex-shrink: 0;
}

/* ── Drop zone (hash re-verification) ───────────────────────────────────── */

.drop-zone-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--outline-variant);
  border-radius: 0.5rem;
  padding: 1.25rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--on-surface-variant);
  transition:
    border-color 0.2s,
    background 0.2s;
  text-align: center;
  outline: none;
  margin-top: 0.75rem;
}

.drop-zone-sm:hover,
.drop-zone-sm:focus,
.drop-zone-sm.drag-over {
  border-color: var(--primary);
  background: rgba(230, 0, 0, 0.05);
  color: var(--on-surface);
}

/* ── Encrypted notice ───────────────────────────────────────────────────── */

.encrypted-notice {
  background: rgba(230, 0, 0, 0.05);
  border: 1px solid rgba(230, 0, 0, 0.2);
  border-radius: 0.5rem;
  padding: 1.25rem;
  margin-top: 0.75rem;
}

.encrypted-notice h3 {
  padding-top: 0;
  color: var(--primary);
  margin-bottom: 0.25rem;
  font-size: 1rem;
  font-weight: 600;
}

/* ── Icon / copy buttons ────────────────────────────────────────────────── */

.icon-btn {
  background: transparent;
  border: 1px solid rgba(95, 63, 58, 0.2);
  border-radius: 0.25rem;
  color: var(--on-surface-variant);
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
  flex-shrink: 0;
}

.icon-btn:hover {
  color: var(--on-surface);
  border-color: var(--outline);
}

/* ── Utility classes (used by verify.js innerHTML) ──────────────────────── */

.mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
}

.dim {
  color: var(--on-surface-variant);
}

.hash-break {
  word-break: break-all;
  line-height: 1.6;
}

/* ── Scrollbar ──────────────────────────────────────────────────────────── */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--outline-variant);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--outline);
}

/* ── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .detail-label {
    min-width: 110px;
  }
  .meta-row {
    grid-template-columns: minmax(120px, 35%) 1fr;
  }
}
