/* ==============================================================================
   VeritasEngine - Vibrant Pink & Sky Blue Theme System
   Vibrant Canvas Palette: Pink (#f472b6 / #ec4899) & Sky Blue (#38bdf8 / #3b82f6)
   ============================================================================== */

:root {
  /* Vibrant Pink & Blue Canvas */
  --bg-primary: #fce4ec;
  --bg-secondary: #e3f2fd;
  --bg-card: rgba(255, 255, 255, 0.92);
  --border-color: rgba(244, 114, 182, 0.35);
  --border-focus: #38bdf8;
  
  /* Pink Accents */
  --pink-light: #fce7f3;
  --pink-main: #f472b6;
  --pink-bold: #ec4899;
  --pink-dark: #be185d;

  /* Sky Blue Accents */
  --blue-light: #e0f2fe;
  --blue-main: #38bdf8;
  --blue-bold: #3b82f6;
  --blue-dark: #0369a1;

  /* Status Badges */
  --accent-cyan: #0284c7;
  --accent-emerald: #059669;
  --accent-indigo: #4f46e5;
  --accent-rose: #e11d48;
  --accent-amber: #d97706;

  /* Typography */
  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #64748b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

body {
  background: linear-gradient(135deg, #fce4ec 0%, #e3f2fd 50%, #f8bbd0 100%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(244, 114, 182, 0.15), 0 4px 14px rgba(56, 189, 248, 0.12);
}

/* Layout Container */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  width: 100%;
}

/* Top Header Bar - Pink to Blue Gradient */
.header-bar {
  background: linear-gradient(90deg, rgba(252, 228, 236, 0.95) 0%, rgba(227, 242, 253, 0.95) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--pink-main);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(244, 114, 182, 0.25);
  flex-wrap: wrap;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, var(--pink-bold) 0%, var(--blue-bold) 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.4rem;
  box-shadow: 0 4px 16px rgba(236, 72, 153, 0.45);
  shrink: 0;
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, var(--pink-dark), var(--blue-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

.brand-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(236, 72, 153, 0.18);
  border: 1px solid rgba(236, 72, 153, 0.4);
  color: var(--pink-dark);
}

/* Header Navigation Buttons */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.7);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(244, 114, 182, 0.3);
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.nav-btn:hover {
  background: rgba(244, 114, 182, 0.15);
  color: var(--pink-dark);
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--pink-bold) 0%, var(--blue-bold) 100%);
  color: #ffffff;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.4);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.8);
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(244, 114, 182, 0.3);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.green {
  background: #059669;
  box-shadow: 0 0 8px #059669;
}

.status-dot.blue {
  background: #3b82f6;
  box-shadow: 0 0 8px #3b82f6;
}

/* Preset Chips */
.presets-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.preset-chip {
  background: #ffffff;
  border: 1px solid rgba(244, 114, 182, 0.4);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(244, 114, 182, 0.1);
}

.preset-chip:hover {
  background: var(--pink-light);
  border-color: var(--pink-bold);
  color: var(--pink-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(236, 72, 153, 0.25);
}

/* Query Box */
.query-box-container {
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}

.query-textarea {
  width: 100%;
  background: #ffffff;
  border: 2px solid rgba(244, 114, 182, 0.4);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  resize: vertical;
  min-height: 90px;
  margin-bottom: 1rem;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.query-textarea:focus {
  outline: none;
  border-color: var(--blue-bold);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.35);
}

.query-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink-bold) 0%, var(--blue-bold) 100%);
  border: none;
  color: #ffffff;
  padding: 0.75rem 1.6rem;
  font-size: 0.92rem;
  font-weight: 800;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(236, 72, 153, 0.55);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Live Pipeline Stepper */
.pipeline-stepper {
  padding: 1.25rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  overflow-x: auto;
  gap: 0.5rem;
}

.agent-node {
  background: #ffffff;
  border: 1px solid rgba(244, 114, 182, 0.3);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 125px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.agent-icon {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.agent-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}

.agent-node.active {
  background: var(--pink-light);
  border-color: var(--pink-bold);
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.45);
  animation: pulse-node 1.5s infinite;
}

.agent-node.passed {
  background: var(--blue-light);
  border-color: var(--blue-bold);
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

@keyframes pulse-node {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.pipeline-arrow {
  color: var(--pink-main);
  font-size: 1.25rem;
  font-weight: 800;
}

/* Decision Hero Card */
.decision-hero {
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 2rem;
  align-items: center;
  border-left: 6px solid var(--pink-bold);
}

@media (max-width: 768px) {
  .decision-hero {
    grid-template-columns: 1fr;
  }
}

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

.confidence-circle {
  width: 115px;
  height: 115px;
  border-radius: 50%;
  border: 6px solid #e2e8f0;
  border-top-color: var(--pink-bold);
  border-right-color: var(--blue-bold);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin-bottom: 0.5rem;
  background: #ffffff;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.03), 0 4px 14px rgba(236, 72, 153, 0.2);
}

.confidence-val {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: var(--font-mono);
}

.confidence-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.decision-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.decision-badge {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 0.88rem;
  letter-spacing: 0.03em;
}

.badge-accepted {
  background: rgba(5, 150, 105, 0.15);
  color: #059669;
  border: 1.5px solid rgba(5, 150, 105, 0.4);
}

.badge-warnings {
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
  border: 1.5px solid rgba(217, 119, 6, 0.4);
}

.badge-declined {
  background: rgba(71, 85, 105, 0.15);
  color: #475569;
  border: 1.5px solid rgba(71, 85, 105, 0.4);
}

.badge-rejected {
  background: rgba(225, 29, 72, 0.15);
  color: #e11d48;
  border: 1.5px solid rgba(225, 29, 72, 0.4);
}

.decision-metrics-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.5rem;
}

.metric-pill {
  background: #ffffff;
  border: 1px solid rgba(244, 114, 182, 0.3);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.metric-pill-val {
  font-size: 1.1rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-main);
  display: block;
}

.metric-pill-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Verifier Cards Grid */
.verifier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.verifier-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid rgba(244, 114, 182, 0.3);
}

.vcard-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.vcard-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-main);
}

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

/* Output Card */
.output-card {
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}

.output-content {
  background: #fdf5f9;
  border: 1px solid rgba(244, 114, 182, 0.3);
  border-radius: 10px;
  padding: 1.25rem;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--text-main);
  font-family: var(--font-mono);
}

/* Deep Audit Subtabs */
.audit-details-card {
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.audit-subtabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.audit-subtab-btn {
  background: #ffffff;
  border: 1px solid rgba(244, 114, 182, 0.3);
  color: var(--text-muted);
  padding: 7px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.audit-subtab-btn:hover {
  background: var(--pink-light);
  color: var(--pink-dark);
}

.audit-subtab-btn.active {
  background: linear-gradient(135deg, var(--pink-bold) 0%, var(--blue-bold) 100%);
  border: none;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3);
}

.audit-panel {
  display: none;
}

.audit-panel.active {
  display: block;
}

/* Tables */
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.audit-table th {
  background: #fce7f3;
  color: var(--pink-dark);
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid rgba(244, 114, 182, 0.4);
}

.audit-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
}

.audit-table tr:hover {
  background: rgba(252, 231, 243, 0.5);
}

/* Status Badges */
.status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-passed {
  background: rgba(5, 150, 105, 0.15);
  color: #059669;
  border: 1px solid rgba(5, 150, 105, 0.3);
}

.status-failed {
  background: rgba(225, 29, 72, 0.15);
  color: #e11d48;
  border: 1px solid rgba(225, 29, 72, 0.3);
}

.status-warning {
  background: rgba(217, 119, 6, 0.15);
  color: #d97706;
  border: 1px solid rgba(217, 119, 6, 0.3);
}

.status-skipped {
  background: rgba(148, 163, 184, 0.18);
  color: #475569;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Benchmark Hero & Scorecards */
.benchmark-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fce7f3 0%, #e0f2fe 100%);
  border-radius: 14px;
  margin-bottom: 1.75rem;
  border: 1.5px solid rgba(244, 114, 182, 0.4);
}

.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.scorecard-item {
  padding: 1.5rem;
  text-align: center;
  background: #ffffff;
  border: 1px solid rgba(244, 114, 182, 0.3);
}

.scorecard-val {
  font-size: 2rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--pink-bold);
}

.scorecard-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 4px;
}

/* Modal Styling for Agent Cards */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-content {
  max-width: 650px;
  width: 100%;
  background: #ffffff;
  border: 2px solid var(--pink-main);
  padding: 1.75rem;
  box-shadow: 0 20px 50px rgba(244, 114, 182, 0.3);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(244, 114, 182, 0.3);
}

.modal-close {
  background: rgba(244, 114, 182, 0.15);
  border: none;
  color: var(--pink-dark);
  font-size: 1.5rem;
  font-weight: 700;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--pink-bold);
  color: #ffffff;
}

.agent-card-interactive {
  cursor: pointer;
  transition: all 0.3s ease;
  background: #ffffff;
  border: 1.5px solid rgba(244, 114, 182, 0.3);
}

.agent-card-interactive:hover {
  transform: translateY(-4px);
  border-color: var(--pink-bold);
  box-shadow: 0 12px 30px rgba(244, 114, 182, 0.25);
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
