/* ==========================================================================
   DATAFORGE — DATA DOCTOR FLAGSHIP STYLES
   Professional Data Utility Interface: Upload -> Detect -> Fix -> Analyze -> Download
   Preserving Dark SaaS Identity, Typography & Cyan Accent System
   ========================================================================== */

/* Main Flagship Container */
.data-doctor-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
  padding: 2.25rem;
  margin-top: 1.5rem;
  position: relative;
  overflow: hidden;
}

.data-doctor-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  opacity: 0.7;
}

/* 5-Step Workflow Stepper */
.doctor-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.25rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow-x: auto;
  gap: 1rem;
}

.stepper-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  opacity: 0.45;
  transition: all var(--transition-normal);
  white-space: nowrap;
  user-select: none;
}

.stepper-item.active {
  opacity: 1;
}

.stepper-item.completed {
  opacity: 0.85;
}

.stepper-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.stepper-item.active .stepper-number {
  background: var(--accent-cyan);
  color: var(--text-inverse);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px -2px var(--accent-cyan-glow);
}

.stepper-item.completed .stepper-number {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald);
  border-color: var(--accent-emerald);
}

.stepper-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.stepper-item.active .stepper-title {
  color: var(--text-primary);
}

.stepper-arrow {
  color: var(--border-default);
  font-size: 0.85rem;
  opacity: 0.6;
}

/* Upload Experience */
.doctor-upload-zone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: 3.5rem 2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.015);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

.doctor-upload-zone:hover,
.doctor-upload-zone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.03);
  box-shadow: 0 0 30px -5px var(--accent-cyan-glow);
}

.doctor-upload-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  color: var(--accent-cyan);
  transition: transform var(--transition-normal);
}

.doctor-upload-zone:hover .doctor-upload-icon {
  transform: translateY(-3px) scale(1.05);
}

.doctor-upload-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.doctor-upload-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.doctor-upload-formats {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
}

.format-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.doctor-upload-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.doctor-privacy-notice {
  margin-top: 1.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Health Report Section */
.doctor-report-section {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.doctor-report-top {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.75rem;
  align-items: stretch;
}

@media (max-width: 900px) {
  .doctor-report-top {
    grid-template-columns: 1fr;
  }
}

/* Health Gauge Card */
.health-gauge-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}

.gauge-svg-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 1rem;
}

.gauge-circle-bg {
  fill: none;
  stroke: var(--bg-primary);
  stroke-width: 10;
}

.gauge-circle-fill {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 1s ease, stroke 0.4s ease;
}

.gauge-score-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gauge-score-number {
  font-family: var(--font-mono);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}

.gauge-score-grade {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
}

.health-status-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Dataset Metrics Overview */
.report-overview-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  justify-content: center;
}

.metrics-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
}

.metric-stat-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.metric-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.metric-stat-value {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-stat-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Fix Hero Banner */
.fix-hero-banner {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08) 0%, rgba(99, 102, 241, 0.05) 100%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.fix-banner-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.fix-banner-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.fix-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Issues Breakdown Grid */
.issues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.issue-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color var(--transition-fast);
}

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

.issue-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.issue-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.issue-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.issue-icon.high { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); }
.issue-icon.medium { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.issue-icon.low { background: rgba(56, 189, 248, 0.15); color: var(--accent-blue); }
.issue-icon.safe { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); }

.issue-name {
  font-size: 0.925rem;
  font-weight: 600;
  color: var(--text-primary);
}

.severity-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
}

.severity-pill.high { background: rgba(244, 63, 94, 0.15); color: var(--accent-rose); border: 1px solid rgba(244, 63, 94, 0.3); }
.severity-pill.medium { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid rgba(245, 158, 11, 0.3); }
.severity-pill.low { background: rgba(56, 189, 248, 0.15); color: var(--accent-blue); border: 1px solid rgba(56, 189, 248, 0.3); }
.severity-pill.safe { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }

.issue-desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.issue-detail-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  max-height: 100px;
  overflow-y: auto;
}

.issue-fix-type {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
}

.issue-fix-type.auto { color: var(--accent-emerald); }
.issue-fix-type.review { color: var(--accent-amber); }

/* Before vs After Comparative Stats */
.comparison-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.comparison-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.comp-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem;
}

.comp-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.comp-values {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  font-weight: 700;
}

.comp-before { color: var(--accent-rose); text-decoration: line-through; opacity: 0.8; }
.comp-arrow { color: var(--text-muted); font-size: 0.85rem; }
.comp-after { color: var(--accent-emerald); }

/* Table View Controls & Tabs */
.view-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-tabs-group {
  display: flex;
  gap: 0.5rem;
}

.table-tab-btn {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.table-tab-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

.table-tab-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--accent-cyan);
  border-color: var(--border-default);
  font-weight: 600;
}

/* Interactive Table Wrapper */
.doctor-table-wrap {
  max-height: 380px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
}

.doctor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  text-align: left;
}

.doctor-table th {
  position: sticky;
  top: 0;
  background: var(--bg-surface-elevated);
  padding: 0.65rem 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-default);
  z-index: 2;
  white-space: nowrap;
}

.doctor-table td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
  white-space: nowrap;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.cell-highlight-fixed {
  background: rgba(16, 185, 129, 0.12) !important;
  color: var(--accent-emerald) !important;
  font-weight: 600;
}

.cell-highlight-review {
  background: rgba(245, 158, 11, 0.12) !important;
  color: var(--accent-amber) !important;
  font-weight: 600;
}

.cell-highlight-messy {
  background: rgba(244, 63, 94, 0.12) !important;
  color: var(--accent-rose) !important;
}

/* "Ask Your Data" Analytical Section */
.ask-data-section {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-top: 1.5rem;
}

.ask-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.ask-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ask-title-group p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.ask-privacy-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.1);
  color: var(--accent-emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Quick Query Suggestion Pills */
.ask-pills-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.ask-pill-btn {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.8rem;
  font-size: 0.775rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.ask-pill-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.04);
}

/* Query Input Box */
.ask-input-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.ask-input {
  flex: 1;
  background: var(--bg-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font-sans);
  outline: none;
  transition: all var(--transition-fast);
}

.ask-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px -2px var(--accent-cyan-glow);
}

.ask-submit-btn {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--accent-cyan);
  color: var(--text-inverse);
  font-weight: 600;
  font-size: 0.875rem;
  border: none;
  cursor: pointer;
  transition: opacity var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ask-submit-btn:hover {
  opacity: 0.9;
}

/* Query Response Panel */
.ask-response-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  font-size: 0.875rem;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ask-metric-display {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.ask-metric-val {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.ask-table-result {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.825rem;
  margin-top: 0.5rem;
}

.ask-table-result th {
  background: var(--bg-surface-elevated);
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-secondary);
  text-align: left;
}

.ask-table-result td {
  padding: 0.45rem 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

/* AI API Connector Architecture Notice */
.ai-architecture-toggle {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.ai-connect-link {
  color: var(--accent-cyan);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Download Actions Bar */
.doctor-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-subtle);
  gap: 1rem;
  flex-wrap: wrap;
}

.doctor-actions-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.doctor-actions-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
