/* Modern Dark Mode Design System for C2PA Test Bench */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  --bg-dark: #090d16;
  --bg-card: #121929;
  --bg-card-hover: #1a233a;
  --bg-input: #182238;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.3);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Status Colors */
  --status-verified: #10b981;
  --status-verified-bg: rgba(16, 185, 129, 0.12);
  --status-tsa: #f59e0b;
  --status-tsa-bg: rgba(245, 158, 11, 0.12);
  --status-untrusted: #fb923c;
  --status-untrusted-bg: rgba(251, 146, 60, 0.12);
  --status-expired: #f97316;
  --status-expired-bg: rgba(249, 115, 22, 0.12);
  --status-tampered: #ef4444;
  --status-tampered-bg: rgba(239, 68, 68, 0.12);
  --status-unsigned: #64748b;
  --status-unsigned-bg: rgba(100, 116, 139, 0.12);
  --status-video: #38bdf8;
  --status-video-bg: rgba(56, 189, 248, 0.12);

  --accent-primary: #6366f1;
  --accent-hover: #4f46e5;
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  padding-bottom: 60px;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
header {
  padding: 40px 0 24px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 28px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
}

.brand-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: white;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-text h1 {
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-text p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}



/* Upload Sandbox */
.upload-sandbox {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 32px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.upload-sandbox:hover,
.upload-sandbox.drag-over {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.05);
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.15);
}

.upload-sandbox input[type="file"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.upload-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
}

.upload-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.upload-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.upload-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.upload-btn {
  margin-top: 4px;
  background: var(--accent-primary);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-block;
}



/* Grid Layout */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

/* Test Case Card */
.test-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.test-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* Top Media Container */
.card-media-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  background: #050811;
  overflow: hidden;
}

.card-media-wrapper img,
.card-media-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.test-card:hover .card-media-wrapper img {
  transform: scale(1.03);
}

.media-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(9, 13, 22, 0.75);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  gap: 4px;
}

.media-badge svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Card Content */
.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 12px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 6px;
  width: fit-content;
}

.status-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* Status variants matching extension popup.css (success, warning, danger, neutral) */
.status-badge.verified_trusted {
  color: #10b981;
  background: rgba(16, 185, 129, 0.14);
}

.status-badge.verified_tsa {
  color: #10b981;
  background: rgba(16, 185, 129, 0.14);
}

.status-badge.verified_untrusted {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
}

.status-badge.signing_expired {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.14);
}

.status-badge.content_tampered {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.14);
}

.status-badge.broken_signature {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.14);
}

.status-badge.invalid_or_changed {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.14);
}

.status-badge.no_credentials {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.14);
}

.status-badge.unsupported_format {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.14);
}

.status-badge.custom {
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.14);
}



.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  flex-grow: 1;
}

.tech-tag {
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 2px 7px;
  font-size: 0.75rem;
  border-radius: 4px;
  color: #a5b4fc;
}

.card-footer {
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.inspect-btn {
  background: transparent;
  border: none;
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
  padding: 4px 0;
}

.inspect-btn:hover {
  color: #818cf8;
  transform: translateX(2px);
}

.inspect-btn svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

/* Modal Inspection Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(5, 8, 17, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  transform: translateY(20px);
  transition: transform 0.25s ease;
  overflow: hidden;
}

.modal-overlay.open .modal-content {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.close-modal-btn {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.close-modal-btn:hover {
  color: var(--text-primary);
  background: var(--border-color);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-media-preview {
  width: 100%;
  max-height: 260px;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-media-preview img,
.modal-media-preview video {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.modal-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.detail-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: var(--radius-md);
}

.detail-label {
  font-size: 0.725rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-all;
}

.json-box {
  background: #070a12;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.775rem;
  color: #7dd3fc;
  overflow-x: auto;
  white-space: pre-wrap;
  max-height: 180px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  grid-column: 1 / -1;
  color: var(--text-muted);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin-bottom: 12px;
  stroke: var(--text-muted);
  stroke-width: 1.5;
  fill: none;
}

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

  .modal-details-grid {
    grid-template-columns: 1fr;
  }

  .header-top {
    flex-direction: column;
    align-items: flex-start;
  }
}