/* 15Q Public UI Styles - Vanilla CSS (UI-UX Pro Max Principles) */
:root {
  --primary: #4a148c;
  --primary-hover: #380b6b;
  --bg-color: #f8fafc;
  --text-main: #0F172A;
  --text-muted: #475569;
  --border-color: #e2e8f0;
  --card-bg: rgba(255, 255, 255, 0.95);
  
  --color-pa: #bf4d3f;
  --color-pb: #cf7c22;
  --color-pc: #3c8a5a;
  --color-pd: #3b73a9;
  --color-pe: #b18b16;
}

* { box-sizing: border-box; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 24px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Screens */
.screen { display: none; flex: 1; flex-direction: column; }
.screen.active { display: flex; animation: fadeIn 0.3s ease-out; }

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

/* General Layout & Typography */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

h1 { font-size: 24px; font-weight: 700; margin: 0 0 16px; line-height: 1.3; }
h2 { font-size: 20px; font-weight: 600; margin: 0 0 12px; line-height: 1.4; }
p { font-size: 16px; line-height: 1.6; color: var(--text-muted); margin: 0 0 16px; }

/* Buttons */
.btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, opacity 0.2s;
  width: 100%;
  text-align: center;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.btn:hover:not(:disabled) { background: var(--primary-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid #94a3b8; /* Tối hơn để dễ nhìn */
  font-weight: 600;
}
.btn-outline:hover:not(:disabled) { background: #f1f5f9; color: var(--primary); border-color: var(--primary); }
.btn-sm { padding: 8px 16px; font-size: 14px; width: auto; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 8px; font-weight: 500; }
.form-input, .form-select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s;
  background: white;
  color: var(--text-main);
}
.form-input:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(74, 20, 140, 0.1);
}

/* Question Option Cards */
.option-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px; border: 2px solid var(--border-color);
  border-radius: 12px; margin-bottom: 12px;
  cursor: pointer; transition: all 0.2s ease;
  background: white;
}
.option-card:hover { border-color: #cbd5e1; }
.option-card.selected {
  border-color: var(--primary);
  background-color: rgba(74, 20, 140, 0.03);
}
.option-letter {
  width: 28px; height: 28px; border-radius: 50%;
  background: #f1f5f9; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; flex-shrink: 0; transition: all 0.2s;
}
.option-card.selected .option-letter { background: var(--primary); color: white; }
.option-text { font-size: 15px; line-height: 1.5; padding-top: 3px; }

/* Progress Bar */
.progress-header {
  display: flex; justify-content: space-between;
  margin-bottom: 12px; color: var(--text-muted);
  font-size: 14px; font-weight: 500;
}
.progress-bar-bg {
  width: 100%; height: 6px; background: var(--border-color);
  border-radius: 3px; overflow: hidden; margin-bottom: 24px;
}
.progress-bar-fill { height: 100%; background: var(--primary); transition: width 0.3s ease; }

/* Navigation */
.nav-row { display: flex; gap: 12px; margin-top: auto; padding-top: 24px; }
.nav-row .btn { flex: 1; }

/* Loading State */
.loading-container { align-items: center; justify-content: center; text-align: center; height: 100%; padding: 48px 0; }
.spinner {
  width: 40px; height: 40px; border: 4px solid var(--border-color);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 1s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Results Screen */
.badge { display: inline-block; padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; background: #e2e8f0; color: var(--text-muted); margin-bottom: 16px; border: 1px solid var(--border-color); }
.badge.route-single { background: #fce8e6; color: #a53030; border-color: #f4c7c3; }
.badge.route-mixed { background: #fff3e0; color: #8a6534; border-color: #fce8b2; }
.badge.route-pe-dom { background: #fff8e1; color: #7c6c13; border-color: #f0e4a0; }
.badge.route-diffuse { background: #f0ece4; color: #6d655b; border-color: #ddd1c0; }

.profile-title { font-size: 28px; margin-bottom: 8px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.profile-title-sub { font-size: 16px; color: var(--text-muted); margin-bottom: 24px; font-weight: normal; }

.charts-container { background: white; border: 1px solid var(--border-color); border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.chart-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.bar-label { width: 32px; font-weight: 600; font-size: 14px; color: var(--text-muted); }
.bar-track { flex: 1; height: 16px; background: var(--border-color); border-radius: 8px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 8px; transition: width 1s ease-out; }

/* ═══════════════════════════════════════════════════ */
/* Structured Report Sections                         */
/* ═══════════════════════════════════════════════════ */
.report-section {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0;
  margin-bottom: 16px;
  overflow: hidden;
  animation: fadeIn 0.4s ease-out;
}

.report-section-label {
  padding: 12px 18px;
  font-size: 14px; /* Tăng từ 13px lên 14px để cân đối hơn */
  font-weight: 700;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.snapshot-label {
  background: linear-gradient(135deg, #f3e8ff, #ede9fe);
  color: #6b21a8;
  border-bottom: 1px solid #ddd6fe;
}
.highlight-label {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  color: #065f46;
  border-bottom: 1px solid #a7f3d0;
}
.observe-label {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  color: #1e40af;
  border-bottom: 1px solid #bfdbfe;
}
.limit-label {
  background: linear-gradient(135deg, #fefce8, #fef9c3);
  color: #854d0e;
  border-bottom: 1px solid #fde68a;
}

.report-section-body {
  padding: 16px 18px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-main);
}
.report-section-body p {
  margin: 0 0 10px;
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.7;
}
.report-section-body p:last-child {
  margin-bottom: 0;
}
.report-section-body ul {
  margin: 0;
  padding: 0 0 0 20px;
  list-style-type: disc;
}
.report-section-body li {
  margin-bottom: 8px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-main);
}
.report-section-body li:last-child {
  margin-bottom: 0;
}
.report-section-body strong {
  font-weight: 700;
}
.report-section-body em {
  color: var(--text-muted);
  font-style: italic;
}

/* Legacy analysis box — hidden when structured report is used */
.analysis-box { background: rgba(74,20,140,0.03); padding: 24px; border-radius: 12px; border: 1px solid rgba(74,20,140,0.1); margin-bottom: 24px; }
.analysis-text { color: var(--text-main); font-size: 16px; line-height: 1.7; margin: 0; }

.lookup-box { text-align: center; padding: 20px; background: white; border: 1px dashed #94a3b8; border-radius: 12px; margin-bottom: 24px; }
.lookup-label { display: block; font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.lookup-code { font-family: monospace; font-size: 28px; font-weight: bold; color: var(--primary); letter-spacing: 2px; margin-bottom: 12px; display: block; }

.hook-text { text-align: center; font-style: italic; color: var(--text-muted); margin-bottom: 24px; }

/* Toast Notification */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: #334155; color: white; padding: 12px 24px; border-radius: 8px;
  font-weight: 500; opacity: 0; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 1000; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* Helper classes */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }

/* ═══════════════════════════════════════════════════ */
/* Payment CTA                                        */
/* ═══════════════════════════════════════════════════ */
.payment-cta-box {
  text-align: center;
  padding: 28px 24px;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 2px solid #ddd6fe;
  border-radius: 16px;
  margin-bottom: 24px;
}
.payment-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.payment-cta-box h3 {
  font-size: 18px;
  font-weight: 700;
  color: #5b21b6;
  margin: 0 0 8px;
}
.payment-cta-box p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 16px;
}
.btn-unlock {
  background: linear-gradient(135deg, #7c3aed, #9333ea) !important;
  color: white !important;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 32px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.3);
  width: 100%;
  margin-bottom: 10px;
}
.btn-unlock:hover {
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45) !important;
  transform: translateY(-1px);
}
.payment-note {
  display: block;
  font-size: 12px;
  color: #9ca3af;
}
.payment-cta-box.paid {
  background: linear-gradient(135deg, #ecfdf5, #d1fae5);
  border-color: #a7f3d0;
}
.payment-cta-box.paid h3 {
  color: #065f46;
}

