/**
 * CertiSigma - Verification Report Component
 * 
 * Styles for bundle verification report
 * Mobile-first, clear forensic display
 * 
 * @version 2.0.0
 */

/* ========================================
   VERIFICATION REPORT CONTAINER
   ======================================== */

.verification-report {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

.verification-report-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-6, 1.5rem);
}

/* ========================================
   HEADER (Status Badge)
   ======================================== */

.verification-report-header {
  padding: var(--space-6, 1.5rem);
  border-radius: 12px;
  text-align: center;
}

.verification-report-header--valid {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}

.verification-report-header--invalid {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.verification-status-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3, 0.75rem);
}

.verification-status-icon {
  color: white;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.verification-status-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.verification-status-subtitle {
  font-size: 16px;
  opacity: 0.9;
  margin: 0;
  max-width: 500px;
}

/* ========================================
   ERRORS
   ======================================== */

.verification-errors {
  padding: var(--space-4, 1rem);
  background: #fee2e2;
  border-left: 4px solid #ef4444;
  border-radius: 8px;
}

.verification-errors h3 {
  margin: 0 0 var(--space-2, 0.5rem) 0;
  font-size: 16px;
  color: #991b1b;
}

.verification-errors ul {
  margin: 0;
  padding-left: var(--space-4, 1rem);
  color: #7f1d1d;
}

.verification-errors li {
  margin-bottom: var(--space-1, 0.25rem);
}

/* ========================================
   SECTIONS
   ======================================== */

.verification-section {
  padding: var(--space-4, 1rem);
  background: var(--gray-50, #f9fafb);
  border-radius: 12px;
  border: 1px solid var(--gray-200, #e5e7eb);
}

.verification-section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 var(--space-4, 1rem) 0;
  color: var(--text-primary, #1f2937);
}

/* ========================================
   INFO GRID (Manifest Details)
   ======================================== */

.verification-info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3, 0.75rem);
}

@media (min-width: 640px) {
  .verification-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.verification-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-2, 0.5rem);
  background: white;
  border-radius: 6px;
  font-size: 14px;
}

.verification-info-label {
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
}

.verification-info-value {
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  text-align: right;
}

.verification-info-value--mono {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 12px;
}

/* ========================================
   HASH CHECK
   ======================================== */

.verification-hash-check {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  padding: var(--space-3, 0.75rem);
  border-radius: 8px;
  font-weight: 600;
  margin-bottom: var(--space-3, 0.75rem);
}

.verification-hash-check--valid {
  background: #d1fae5;
  color: #065f46;
}

.verification-hash-check--invalid {
  background: #fee2e2;
  color: #991b1b;
}

.verification-hash-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-2, 0.5rem);
}

.verification-hash-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-1, 0.25rem);
  padding: var(--space-2, 0.5rem);
  background: white;
  border-radius: 6px;
}

.verification-hash-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.verification-hash-value {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 11px;
  color: var(--text-primary, #1f2937);
  word-break: break-all;
  background: var(--gray-100, #f3f4f6);
  padding: var(--space-2, 0.5rem);
  border-radius: 4px;
}

/* ========================================
   ATTESTATION LEVELS (T0/T1)
   ======================================== */

/* ── Seal Timeline ─────────────────────────────────── */
.verification-attestation-levels { padding: 0; }

.seal-timeline {
  display: flex;
  flex-direction: column;
}

/* ── Step row (rail + body) ─────────────────────────── */
.seal-step {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 0 14px;
  min-height: 0;
}

/* ── Left rail: node + line ─────────────────────────── */
.seal-step__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.seal-step__node {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  border: 2.5px solid #d1d5db;
  background: #f9fafb;
  color: #9ca3af;
  transition: all .25s ease;
}

.seal-step__line {
  width: 2px;
  flex: 1;
  min-height: 12px;
  background: #e5e7eb;
  border-radius: 1px;
  transition: background .25s ease;
}

.seal-step--last .seal-step__line { display: none; }

/* ── Node states ─────────────────────────────────── */
.seal-step--verified .seal-step__node {
  border-color: #10b981;
  background: #10b981;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(16, 185, 129, .12);
}

.seal-step--verified .seal-step__line {
  background: #10b981;
}

.seal-step--pending .seal-step__node {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #d97706;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .08);
}

.seal-step--pending .seal-step__line {
  background: #fde68a;
}

.seal-step--not-found .seal-step__node {
  border-color: #ef4444;
  background: #ef4444;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, .10);
}

/* ── Body card ──────────────────────────────────── */
.seal-step__body {
  padding: 0 0 20px;
  min-width: 0;
}

.seal-step--last .seal-step__body { padding-bottom: 0; }

.seal-step__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

/* Tag badge */
.seal-step__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 20px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .6px;
  line-height: 1;
  flex-shrink: 0;
}

.seal-step__tag--t0 { background: #d1fae5; color: #065f46; }
.seal-step__tag--t1 { background: #dbeafe; color: #1e40af; }
.seal-step__tag--t2 { background: #fef3c7; color: #92400e; }

/* Title */
.seal-step__label {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
  line-height: 1.3;
}

/* Status pill */
.seal-step__pill {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.5;
}

.seal-step__pill--verified { background: #d1fae5; color: #065f46; }
.seal-step__pill--pending  { background: #fef3c7; color: #92400e; }
.seal-step__pill--not-found { background: #fee2e2; color: #991b1b; }

/* Info button — subtle ghost icon, no border */
.seal-step__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  max-width: 18px;
  max-height: 18px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0 0 0 4px;
  flex: 0 0 18px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: var(--neutral-400, #a3a3a3);
  font-size: 10px;
  font-weight: 700;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.seal-step__info:hover {
  background: rgba(255, 255, 255, 0.22);
  color: var(--primary-300, #7dd3fc);
}

/* Description */
.seal-step__desc {
  margin: 0 0 2px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary, #6b7280);
}

/* Date / meta */
.seal-step__meta {
  margin: 4px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary, #374151);
  font-variant-numeric: tabular-nums;
}

/* Pending hint */
.seal-step__wait {
  margin: 4px 0 0;
  font-size: 11.5px;
  font-style: italic;
  color: #b45309;
}

/* Fade pending rows slightly */
.seal-step--pending .seal-step__body { opacity: .78; }

/* ── Dark mode ──────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  .seal-step__node {
    border-color: #4b5563;
    background: #1f2937;
    color: #6b7280;
  }

  .seal-step__line { background: #374151; }

  .seal-step--verified .seal-step__node {
    border-color: #10b981;
    background: #10b981;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, .15);
  }

  .seal-step--verified .seal-step__line { background: #059669; }

  .seal-step--pending .seal-step__node {
    border-color: #f59e0b;
    background: #292524;
    color: #fbbf24;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, .10);
  }

  .seal-step--pending .seal-step__line { background: #78350f; }

  .seal-step--not-found .seal-step__node {
    border-color: #ef4444;
    background: #ef4444;
    color: #fff;
  }

  .seal-step__label,
  .seal-step__meta {
    color: var(--text-primary-dark, #f3f4f6);
  }

  .seal-step__desc {
    color: var(--text-secondary-dark, #9ca3af);
  }

  .seal-step__tag--t0 { background: rgba(16,185,129,.14); color: #6ee7b7; }
  .seal-step__tag--t1 { background: rgba(59,130,246,.14); color: #93c5fd; }
  .seal-step__tag--t2 { background: rgba(245,158,11,.14); color: #fcd34d; }

  .seal-step__pill--verified { background: rgba(16,185,129,.14); color: #6ee7b7; }
  .seal-step__pill--pending  { background: rgba(245,158,11,.12); color: #fcd34d; }
  .seal-step__pill--not-found { background: rgba(239,68,68,.14); color: #fca5a5; }

  .seal-step__wait { color: #fbbf24; }
}

/* ========================================
   ITEMS LIST
   ======================================== */

.verification-items-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3, 0.75rem);
}

.verification-item {
  padding: var(--space-3, 0.75rem);
  background: white;
  border-radius: 8px;
  border-left: 4px solid var(--gray-300, #d1d5db);
}

.verification-item--valid {
  border-left-color: #10b981;
}

.verification-item--invalid {
  border-left-color: #ef4444;
}

.verification-item-header {
  display: flex;
  align-items: center;
  gap: var(--space-2, 0.5rem);
  margin-bottom: var(--space-2, 0.5rem);
}

.verification-item-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--text-secondary, #6b7280);
}

.verification-item-icon svg {
  width: 20px;
  height: 20px;
}

.verification-item-title {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
}

.verification-item-status svg {
  width: 20px;
  height: 20px;
}

.verification-item--valid .verification-item-status svg {
  color: #10b981;
}

.verification-item--invalid .verification-item-status svg {
  color: #ef4444;
}

.verification-item-error {
  padding: var(--space-2, 0.5rem);
  background: #fee2e2;
  border-radius: 6px;
  color: #7f1d1d;
  font-size: 14px;
  margin-top: var(--space-2, 0.5rem);
}

.verification-item-details {
  margin-top: var(--space-2, 0.5rem);
  padding-top: var(--space-2, 0.5rem);
  border-top: 1px solid var(--gray-200, #e5e7eb);
  display: flex;
  flex-direction: column;
  gap: var(--space-1, 0.25rem);
}

.verification-item-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.verification-item-detail-label {
  color: var(--text-secondary, #6b7280);
  font-weight: 500;
}

.verification-item-detail-value {
  font-family: 'Monaco', 'Courier New', monospace;
  color: var(--text-primary, #1f2937);
  font-size: 11px;
}

/* ========================================
   ACTIONS
   ======================================== */

.verification-report-actions {
  display: flex;
  gap: var(--space-3, 0.75rem);
  justify-content: center;
  flex-wrap: wrap;
}

.verification-report-actions .btn {
  min-width: 180px;
}

/* ========================================
   ERROR STATE
   ======================================== */

.verification-report-error {
  padding: var(--space-8, 2rem);
  text-align: center;
  color: var(--text-secondary, #6b7280);
}

/* ========================================
   TABLET & DESKTOP
   ======================================== */

@media (min-width: 768px) {
  .verification-status-title {
    font-size: 28px;
  }
  
  .verification-status-subtitle {
    font-size: 18px;
  }
  
  .verification-section-title {
    font-size: 20px;
  }
}

/* ========================================
   MANIFEST HASH HIGHLIGHT BOX
   ======================================== */

.verification-manifest-box {
  padding: 12px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  margin-bottom: 16px;
}

.verification-manifest-box__header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: #059669;
}

.verification-manifest-box__title {
  font-weight: 700;
  font-size: 13px;
  color: #059669;
}

.verification-manifest-box__header .verification-tooltip-trigger {
  background: #d1fae5;
  color: #065f46;
}

.verification-manifest-box__subtitle {
  font-size: 11px;
  color: #6b7280;
  margin-bottom: 6px;
}

.verification-manifest-box__hash {
  word-break: break-all;
  font-size: 11px;
  font-family: 'SF Mono', Monaco, Consolas, monospace;
  color: #065f46;
}

/* ========================================
   DARK MODE
   ======================================== */

@media (prefers-color-scheme: dark) {
  .verification-section {
    background: var(--bg-secondary-dark, #1f2937);
    border-color: var(--gray-600-dark, #4b5563);
  }
  
  .verification-section-title,
  .verification-item-title,
  .verification-info-value,
  .verification-hash-value,
  .verification-item-detail-value {
    color: var(--text-primary-dark, #f9fafb);
  }
  
  .verification-info-item,
  .verification-item,
  .verification-hash-row {
    background: var(--bg-primary-dark, #111827);
  }
  
  .verification-info-label,
  .verification-hash-label,
  .verification-item-detail-label {
    color: var(--text-secondary-dark, #9ca3af);
  }
  
  .verification-hash-value {
    background: var(--gray-800-dark, #1f2937);
  }

  .verification-manifest-box {
    background: rgba(5, 150, 105, 0.08);
    border-color: rgba(5, 150, 105, 0.25);
  }

  .verification-manifest-box__title,
  .verification-manifest-box__header {
    color: #34d399;
  }

  .verification-manifest-box__header .verification-tooltip-trigger {
    background: rgba(52, 211, 153, 0.15);
    color: #6ee7b7;
  }

  .verification-manifest-box__subtitle {
    color: #94a3b8;
  }

  .verification-manifest-box__hash {
    color: #6ee7b7;
  }

  .verification-hash-check--valid {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
  }

  .verification-hash-check--invalid {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
  }

  .verification-info-item {
    border-color: rgba(255, 255, 255, 0.06);
  }

  .verification-tooltip-trigger {
    background: rgba(255, 255, 255, 0.1);
    color: #94a3b8;
  }
}

/* ========================================
   SOURCE BADGE (Cloud Certified / App)
   ======================================== */

.verification-source-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid;
}

.verification-source-badge--source-cloud {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.08) 0%, rgba(13, 148, 136, 0.04) 100%);
  border-color: rgba(20, 184, 166, 0.25);
}

.verification-source-badge--source-app {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.04) 100%);
  border-color: rgba(59, 130, 246, 0.25);
}

.verification-source-badge--source-default {
  background: var(--gray-50, #f9fafb);
  border-color: var(--gray-200, #e5e7eb);
}

.verification-source-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  flex-shrink: 0;
}

.verification-source-badge--source-cloud .verification-source-icon {
  background: rgba(20, 184, 166, 0.15);
  color: #0d9488;
}

.verification-source-badge--source-app .verification-source-icon {
  background: rgba(59, 130, 246, 0.15);
  color: #2563eb;
}

.verification-source-badge--source-default .verification-source-icon {
  background: var(--gray-100, #f3f4f6);
  color: var(--gray-600, #4b5563);
}

.verification-source-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.verification-source-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-900, #111827);
}

.verification-source-desc {
  font-size: 12px;
  color: var(--gray-500, #6b7280);
}

/* ========================================
   PRINT
   ======================================== */

/* ========================================
   COMPACT TIMELINE (inside hash result card)
   ======================================== */
.seal-timeline--compact {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(128, 128, 128, 0.2);
}

@media print {
  .verification-report-actions {
    display: none;
  }
  
  .verification-report-header {
    background: white !important;
    color: black !important;
    border: 2px solid #000;
  }
}


