/* ===== Citation Relevancy Study — Styles ===== */

:root {
  --blue: #2563eb;
  --blue-light: #dbeafe;
  --blue-dark: #1d4ed8;
  --green: #16a34a;
  --green-light: #dcfce7;
  --orange: #ea580c;
  --orange-light: #fff7ed;
  --red: #dc2626;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* --- Layout --- */
.page { max-width: 900px; margin: 0 auto; padding: 24px; }
.page-wide { max-width: 1400px; margin: 0 auto; padding: 24px; }

.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card h2 { margin-bottom: 16px; color: var(--gray-900); }
.card h3 { margin-bottom: 12px; color: var(--gray-700); }

/* --- Header / Progress --- */
.study-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.study-header h1 { font-size: 1.1rem; color: var(--gray-700); }

.progress-bar-container {
  width: 200px;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--blue);
  border-radius: 4px;
  transition: width 0.3s ease;
}

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

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { background: var(--gray-300); cursor: not-allowed; }

.btn-secondary { background: var(--gray-200); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-300); }

.btn-lg { padding: 14px 36px; font-size: 1.05rem; }

/* --- Forms --- */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gray-700);
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-light); }

textarea.form-input { min-height: 80px; resize: vertical; }

/* --- Rating Scale --- */
.rating-scale {
  display: flex;
  gap: 0;
  margin: 12px 0;
}

.rating-option {
  flex: 1;
  text-align: center;
}

.rating-option input[type="radio"] { display: none; }

.rating-option label {
  display: block;
  padding: 14px 8px;
  border: 2px solid var(--gray-200);
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s;
  background: #fff;
}

.rating-option:first-child label {
  border-radius: var(--radius) 0 0 var(--radius);
}

.rating-option:last-child label {
  border-radius: 0 var(--radius) var(--radius) 0;
}

.rating-option label:hover { background: var(--blue-light); border-color: var(--blue); }

.rating-option input[type="radio"]:checked + label {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.rating-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  margin-top: 4px;
  color: inherit;
}

/* --- Trial Layout --- */
.trial-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-height: calc(100vh - 140px);
}

@media (max-width: 1024px) {
  .trial-layout { grid-template-columns: 1fr; }
}

.trial-left, .trial-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* --- Claim Box --- */
.claim-box {
  background: #fff;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  padding: 20px;
}

.claim-box .claim-text {
  font-size: 1.05rem;
  line-height: 1.7;
}

.citation-marker {
  background: #fef08a;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 700;
  border: 1px solid #eab308;
}

/* --- Citation Metadata --- */
.citation-meta {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 0.9rem;
}

.citation-meta .meta-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.citation-meta .meta-label {
  font-weight: 600;
  color: var(--gray-500);
  min-width: 80px;
}

/* --- Evidence Panel --- */
.evidence-panel {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
}

.evidence-panel .evidence-text {
  font-size: 0.95rem;
  line-height: 1.7;
  background: #fffbeb;
  padding: 12px;
  border-left: 3px solid #f59e0b;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.evidence-panel .evidence-location {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--gray-500);
}

/* --- Auto-Detection Panel (Conditions B/D) --- */
.auto-panel {
  background: var(--orange-light);
  border: 1px solid #fdba74;
  border-radius: var(--radius);
  padding: 16px;
}

.auto-panel h3 {
  color: var(--orange);
  font-size: 0.95rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auto-passage {
  background: #fff;
  border: 1px solid #fdba74;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.auto-passage:hover { box-shadow: var(--shadow-md); }

.auto-passage .passage-snippet {
  font-size: 0.9rem;
  line-height: 1.6;
}

.auto-passage .passage-meta {
  font-size: 0.8rem;
  color: var(--gray-500);
  margin-top: 6px;
}

/* --- LLM Panel (Conditions C/D) --- */
.llm-panel {
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: var(--radius);
  padding: 16px;
}

.llm-panel h3 {
  color: var(--green);
  font-size: 0.95rem;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.llm-section {
  margin-bottom: 12px;
  padding: 10px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid #bbf7d0;
}

.llm-section .llm-label {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.llm-section .llm-value {
  font-size: 0.9rem;
  line-height: 1.5;
}

.llm-disclaimer {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-style: italic;
  padding: 8px;
  background: #fefce8;
  border-radius: 4px;
  margin-top: 8px;
}

/* --- Condition Badge --- */
.condition-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

.condition-badge.cond-A { background: var(--gray-100); color: var(--gray-600); }
.condition-badge.cond-B { background: var(--orange-light); color: var(--orange); }
.condition-badge.cond-C { background: var(--green-light); color: var(--green); }
.condition-badge.cond-D { background: #ede9fe; color: #7c3aed; }

/* --- PDF Link --- */
.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.pdf-link:hover { background: var(--blue); color: #fff; }

/* --- Questionnaire --- */
.likert-scale {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin: 8px 0 16px;
}

.likert-option {
  flex: 1;
  text-align: center;
}

.likert-option input[type="radio"] { display: none; }

.likert-option label {
  display: block;
  padding: 10px 4px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.likert-option label:hover { border-color: var(--blue); background: var(--blue-light); }
.likert-option input:checked + label {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* 7-point Likert scale - smaller options */
.likert-7 .likert-option label {
  padding: 8px 2px;
  font-size: 0.85rem;
}

.likert-7 .likert-option label .text-sm {
  font-size: 0.7rem;
  line-height: 1.2;
}

/* Required field indicator */
.required {
  color: var(--red);
}

/* --- Landing --- */
.landing-hero {
  text-align: center;
  padding: 60px 20px;
}

.landing-hero h1 { font-size: 2rem; margin-bottom: 16px; }
.landing-hero p { font-size: 1.1rem; color: var(--gray-600); margin-bottom: 32px; max-width: 600px; margin-left: auto; margin-right: auto; }

/* --- Instructions --- */
.instructions-content { font-size: 0.95rem; }
.instructions-content p { margin-bottom: 12px; }
.instructions-content .scale-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.scale-item {
  text-align: center;
  padding: 12px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-weight: 600;
}

.scale-item .num { font-size: 1.2rem; color: var(--blue); }
.scale-item .desc { font-size: 0.85rem; color: var(--gray-600); margin-top: 4px; }

/* --- Completion --- */
.completion-card {
  text-align: center;
  padding: 40px;
}

.completion-code {
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--green-light);
  color: var(--green);
  padding: 16px 32px;
  border-radius: var(--radius);
  display: inline-block;
  margin: 20px 0;
  letter-spacing: 0.1em;
}

/* --- Practice feedback --- */
.feedback-correct {
  background: var(--green-light);
  border: 1px solid var(--green);
  padding: 16px;
  border-radius: var(--radius);
  margin-top: 12px;
}

.feedback-incorrect {
  background: #fef2f2;
  border: 1px solid var(--red);
  padding: 16px;
  border-radius: var(--radius);
  margin-top: 12px;
}

/* --- Misc --- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: var(--gray-500); }
