/* ====================================================================
   PAGES.CSS — Shared styles for Upload, Processing & Results pages
   ==================================================================== */

/* ===== PAGE LAYOUT ===== */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-main {
  flex: 1;
  padding: 120px 24px 80px;
  position: relative;
  overflow: hidden;
}

.page-main .hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
}

.page-main .hero-glow-1 {
  width: 500px;
  height: 500px;
  top: -15%;
  left: -10%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12), transparent 70%);
}

.page-main .hero-glow-2 {
  width: 400px;
  height: 400px;
  bottom: -10%;
  right: -5%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08), transparent 70%);
}

.page-container {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.page-header {
  text-align: center;
  margin-bottom: 48px;
}

.page-header .section-tag {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-light);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 100px;
  margin-bottom: 16px;
}

.page-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--text-muted);
  transition: var(--transition);
}

.breadcrumb a:hover {
  color: var(--primary-light);
}

.breadcrumb .separator {
  color: var(--text-muted);
  opacity: 0.4;
}

.breadcrumb .current {
  color: var(--text-secondary);
  font-weight: 500;
}


/* ========================================================================
   UPLOAD PAGE
   ======================================================================== */

/* ===== DROP ZONE ===== */
.upload-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: start;
}

.dropzone-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition);
}

.dropzone {
  position: relative;
  border: 2px dashed rgba(59, 130, 246, 0.25);
  border-radius: 14px;
  padding: 60px 32px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: rgba(59, 130, 246, 0.02);
  overflow: hidden;
}

.dropzone::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.06), transparent 70%);
  opacity: 0;
  transition: var(--transition);
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.05);
}

.dropzone:hover::before,
.dropzone.drag-over::before {
  opacity: 1;
}

.dropzone.drag-over {
  transform: scale(1.01);
  box-shadow: 0 0 40px rgba(59, 130, 246, 0.15);
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 16px;
  background: rgba(59, 130, 246, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.dropzone:hover .dropzone-icon {
  background: rgba(59, 130, 246, 0.15);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.dropzone-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.dropzone-title span {
  color: var(--primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dropzone-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

.dropzone-input {
  display: none;
}

/* Browse button */
.browse-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 10px 24px;
  background: var(--primary);
  color: white;
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  z-index: 1;
}

.browse-btn:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

/* Upload info chips */
.upload-info {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.upload-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.upload-chip svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  opacity: 0.7;
}

/* ===== FILE SELECTED STATE ===== */
.file-preview {
  display: none;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 16px 20px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.file-preview.visible {
  display: flex;
}

.file-preview-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F87171;
  flex-shrink: 0;
}

.file-preview-info {
  flex: 1;
  min-width: 0;
}

.file-preview-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-preview-size {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.file-preview-remove {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.file-preview-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #F87171;
}

/* ===== UPLOAD PROGRESS ===== */
.upload-progress {
  display: none;
  margin-top: 24px;
}

.upload-progress.visible {
  display: block;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.progress-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.progress-percent {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-light);
  font-variant-numeric: tabular-nums;
}

.progress-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 100px;
  transition: width 0.3s ease;
  position: relative;
}

.progress-bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
  border-radius: 100px;
  animation: progressShine 1.5s ease-in-out infinite;
}

@keyframes progressShine {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

.upload-complete {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-light);
}

.upload-complete.visible {
  display: flex;
}

.upload-complete svg {
  width: 18px;
  height: 18px;
}

/* ===== SIDEBAR INFO ===== */
.upload-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.info-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition);
}

.info-card:hover {
  border-color: var(--border-hover);
}

.info-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.info-card-title svg {
  width: 18px;
  height: 18px;
  color: var(--primary-light);
}

.info-list {
  list-style: none;
}

.info-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.info-list li:last-child {
  border-bottom: none;
}

.info-list li svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex-shrink: 0;
}

/* Supported formats */
.format-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.format-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.15);
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 600;
  color: #FCA5A5;
}

.format-badge svg {
  width: 16px;
  height: 16px;
}

.format-badge.disabled {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  opacity: 0.5;
}

/* ===== UPLOAD HISTORY ===== */
.history-section {
  margin-top: 56px;
}

.history-section .section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin-bottom: 40px;
}

.history-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-title svg {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
}

.history-table-wrap {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table thead {
  background: rgba(255, 255, 255, 0.02);
}

.history-table th {
  padding: 14px 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.history-table td {
  padding: 14px 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.history-table tbody tr {
  transition: var(--transition);
}

.history-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.history-table tbody tr:last-child td {
  border-bottom: none;
}

.history-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.history-status.completed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-light);
}

.history-status.processing {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-light);
}

.history-status.failed {
  background: rgba(239, 68, 68, 0.1);
  color: #FCA5A5;
}

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

.history-action-btn {
  padding: 6px 12px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--primary-light);
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
}

.history-action-btn:hover {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}


/* ========================================================================
   PROCESSING PAGE
   ======================================================================== */

.processing-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

/* ===== ANIMATED ORB ===== */
.processing-orb-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin-bottom: 48px;
}

.processing-orb {
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}

.orb-ring-1 {
  inset: 0;
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  animation: orbSpin1 2.5s linear infinite;
}

.orb-ring-2 {
  inset: 15px;
  border-bottom-color: var(--accent);
  border-left-color: var(--accent);
  animation: orbSpin2 3s linear infinite;
}

.orb-ring-3 {
  inset: 30px;
  border-top-color: var(--purple);
  border-right-color: rgba(139, 92, 246, 0.4);
  animation: orbSpin1 2s linear infinite reverse;
}

.orb-core {
  position: absolute;
  inset: 50px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.3), rgba(16, 185, 129, 0.15), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: orbPulse 2s ease-in-out infinite;
}

.orb-core svg {
  width: 40px;
  height: 40px;
  color: var(--primary-light);
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.5));
}

.orb-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1), transparent 60%);
  animation: orbPulse 3s ease-in-out infinite;
}

@keyframes orbSpin1 {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes orbSpin2 {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.8; }
}

/* ===== PROCESSING TEXT ===== */
.processing-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.processing-filename {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 36px;
  font-family: 'Courier New', monospace;
  padding: 6px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
}

/* ===== OVERALL PROGRESS BAR ===== */
.processing-progress {
  width: 100%;
  max-width: 480px;
  margin-bottom: 48px;
}

.processing-progress .progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.processing-progress .progress-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.processing-progress .progress-percent {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-light);
  font-variant-numeric: tabular-nums;
}

.processing-progress .progress-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
}

.processing-progress .progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 100px;
  transition: width 0.5s ease;
}

/* ===== PIPELINE STEPS ===== */
.processing-steps {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.proc-step {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  position: relative;
}

.proc-step::after {
  content: '';
  position: absolute;
  left: 31px;
  bottom: -1px;
  width: 2px;
  height: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.proc-step:last-child::after {
  display: none;
}

.proc-step-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
  z-index: 2;
}

.proc-step-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  text-align: left;
}

.proc-step-time {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0;
  font-variant-numeric: tabular-nums;
  transition: var(--transition);
}

/* Step States */
.proc-step.active {
  background: rgba(59, 130, 246, 0.05);
}

.proc-step.active .proc-step-icon {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--primary);
  color: var(--primary-light);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.2);
  animation: stepPulse 1.5s ease-in-out infinite;
}

.proc-step.active .proc-step-text {
  color: var(--text);
  font-weight: 600;
}

.proc-step.active .proc-step-time {
  opacity: 1;
  color: var(--primary-light);
}

.proc-step.completed .proc-step-icon {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--accent-light);
}

.proc-step.completed .proc-step-text {
  color: var(--text-secondary);
}

.proc-step.completed .proc-step-time {
  opacity: 1;
  color: var(--accent);
}

.proc-step.completed::after {
  background: rgba(16, 185, 129, 0.3);
}

@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(59, 130, 246, 0.2); }
  50% { box-shadow: 0 0 24px rgba(59, 130, 246, 0.35); }
}

/* ===== PROCESSING COMPLETE ===== */
.processing-done {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
}

.processing-done.visible {
  display: flex;
  animation: fadeInUp 0.5s ease both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.done-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 100px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-light);
}

.done-badge svg {
  width: 18px;
  height: 18px;
}


/* ========================================================================
   RESULTS PAGE
   ======================================================================== */

/* ===== RESULTS HEADER ===== */
.results-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.results-file-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.results-file-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #F87171;
}

.results-file-icon svg {
  width: 24px;
  height: 24px;
}

.results-filename {
  font-size: 1.1rem;
  font-weight: 700;
}

.results-file-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.results-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== RESULTS GRID ===== */
.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}

.result-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: var(--transition);
}

.result-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px -10px rgba(0, 0, 0, 0.3);
}

.result-card-full {
  grid-column: 1 / -1;
}

.result-card-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-card-label svg {
  width: 16px;
  height: 16px;
  color: var(--primary-light);
}

/* ===== DISCIPLINE PREDICTION ===== */
.discipline-display {
  display: flex;
  align-items: center;
  gap: 24px;
}

.discipline-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary-light), var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.discipline-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--primary-light);
  margin-top: 8px;
}

/* ===== CIRCULAR CONFIDENCE ===== */
.confidence-display {
  display: flex;
  align-items: center;
  gap: 28px;
}

.circular-progress {
  position: relative;
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.circular-progress svg {
  transform: rotate(-90deg);
  width: 120px;
  height: 120px;
}

.circular-progress .track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 8;
}

.circular-progress .fill {
  fill: none;
  stroke: url(#circleGrad);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 339.292;
  stroke-dashoffset: 339.292;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.circular-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.circular-number {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.circular-suffix {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.confidence-details {
  flex: 1;
}

.confidence-label-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.confidence-interpretation {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-light);
  margin-bottom: 12px;
}

.confidence-bar-mini {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 6px;
}

.confidence-bar-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 100px;
  transition: width 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.confidence-alt-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.alt-score {
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 100px;
}

/* ===== DOCUMENT PREVIEW ===== */
.doc-preview-frame {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-muted);
  overflow: hidden;
  position: relative;
}

.doc-preview-frame svg {
  width: 48px;
  height: 48px;
  opacity: 0.4;
}

.doc-preview-frame span {
  font-size: 0.85rem;
}

.doc-preview-mockup {
  position: absolute;
  inset: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0.15;
}

.mock-line {
  height: 8px;
  background: white;
  border-radius: 4px;
}

.mock-line:nth-child(1) { width: 70%; }
.mock-line:nth-child(2) { width: 90%; }
.mock-line:nth-child(3) { width: 60%; }
.mock-line:nth-child(4) { width: 85%; }
.mock-line:nth-child(5) { width: 50%; }
.mock-line:nth-child(6) { width: 75%; }
.mock-line:nth-child(7) { width: 65%; }
.mock-line:nth-child(8) { width: 40%; }

/* ===== KEYWORDS ===== */
.keywords-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.12);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--primary-light);
  transition: var(--transition);
}

.keyword-tag:hover {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.25);
}

/* ===== SENSITIVE INFO ===== */
.sensitive-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sensitive-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.08);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.sensitive-item:hover {
  border-color: rgba(239, 68, 68, 0.15);
  background: rgba(239, 68, 68, 0.06);
}

.sensitive-type-badge {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-xs);
  flex-shrink: 0;
}

.sensitive-type-badge.type-name {
  background: rgba(139, 92, 246, 0.12);
  color: #C4B5FD;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.sensitive-type-badge.type-email {
  background: rgba(59, 130, 246, 0.12);
  color: var(--primary-light);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.sensitive-type-badge.type-phone {
  background: rgba(245, 158, 11, 0.12);
  color: #FCD34D;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.sensitive-type-badge.type-address {
  background: rgba(16, 185, 129, 0.12);
  color: var(--accent-light);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.sensitive-type-badge.type-id {
  background: rgba(236, 72, 153, 0.12);
  color: #F9A8D4;
  border: 1px solid rgba(236, 72, 153, 0.2);
}

.sensitive-value {
  font-size: 0.85rem;
  font-family: 'Courier New', monospace;
  color: var(--text-secondary);
}

.sensitive-redacted {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
}

.sensitive-redacted svg {
  width: 14px;
  height: 14px;
}

.sensitive-count {
  text-align: center;
  padding: 16px;
  margin-top: 12px;
  background: rgba(239, 68, 68, 0.06);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.sensitive-count strong {
  color: #FCA5A5;
}


/* ===== PAGE ANIMATIONS ===== */
.fade-in {
  animation: pageFadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.fade-in-delay-1 { animation-delay: 0.1s; }
.fade-in-delay-2 { animation-delay: 0.2s; }
.fade-in-delay-3 { animation-delay: 0.3s; }
.fade-in-delay-4 { animation-delay: 0.4s; }

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ===== RESPONSIVE — PAGES ===== */
@media (max-width: 1024px) {
  .upload-layout {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .discipline-display {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .page-main {
    padding-top: 100px;
  }

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

  .confidence-display {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .confidence-details {
    width: 100%;
  }

  .history-table-wrap {
    overflow-x: auto;
  }

  .history-table {
    min-width: 600px;
  }

  .dropzone {
    padding: 40px 20px;
  }

  .processing-orb-container {
    width: 160px;
    height: 160px;
  }

  .orb-core {
    inset: 40px;
  }
}

@media (max-width: 480px) {
  .upload-info {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  .results-actions {
    width: 100%;
  }

  .results-actions .btn {
    flex: 1;
    justify-content: center;
  }

  .format-badges {
    flex-direction: column;
  }
}
