/* ===========================
   MedGRPO Project Page Styles
   =========================== */

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --dark: #1e293b;
  --gray: #64748b;
  --light-gray: #f8fafc;
  --white: #ffffff;
  --yellow: #d97706;
  --green: #059669;
  --purple: #7c3aed;
  --border: #e2e8f0;
  --text: #334155;
  --heading: #0f172a;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  line-height: 1.7;
  background: var(--white);
}

/* ---- Container ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container.narrow {
  max-width: 800px;
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(160deg, #0c1220 0%, #162544 40%, #1a365d 70%, #0f172a 100%);
  color: white;
  padding: 5rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 50%, rgba(59,130,246,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 50%, rgba(139,92,246,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.conference-badge {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.4rem 1.4rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 12px rgba(59,130,246,0.3);
}

.paper-title {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.25;
  color: white;
  margin-bottom: 1.5rem;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  letter-spacing: -0.01em;
}

.authors {
  font-size: 1rem;
  color: #cbd5e1;
  margin-bottom: 0.5rem;
  line-height: 2;
}

.authors span,
.authors a {
  white-space: nowrap;
}

.authors a {
  color: #e2e8f0;
  text-decoration: none;
  border-bottom: 1px solid rgba(226, 232, 240, 0.3);
  transition: border-color 0.2s;
}

.authors a:hover {
  border-bottom-color: #e2e8f0;
}

.affiliations {
  font-size: 0.9rem;
  color: #94a3b8;
  margin-bottom: 2rem;
}

/* ---- Buttons ---- */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.3rem;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1.5px solid transparent;
  box-sizing: border-box;
}

.btn-primary {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

.btn-dark {
  background: rgba(255,255,255,0.1);
  color: white;
  border-color: rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
}
.btn-dark:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.4); }

.btn-yellow {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.btn-yellow:hover { background: #fde68a; }

.btn-green {
  background: #d1fae5;
  color: #065f46;
  border-color: #6ee7b7;
}
.btn-green:hover { background: #6ee7b7; }

.btn-purple {
  background: #ede9fe;
  color: #4c1d95;
  border-color: #c4b5fd;
}
.btn-purple:hover { background: #c4b5fd; }

/* ---- Teaser ---- */
.teaser {
  padding: 0;
  background: var(--light-gray);
  margin-top: 1rem;
  position: relative;
  z-index: 2;
}

.teaser .container {
  max-width: 960px;
}

.teaser img {
  width: 100%;
  display: block;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  transform: none;
}

/* ---- Sections ---- */
.section {
  padding: 4.5rem 0;
}

.section-alt {
  background: var(--light-gray);
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--heading);
  text-align: center;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.section-subtitle {
  text-align: center;
  color: var(--gray);
  font-size: 0.95rem;
  margin-bottom: 2.5rem;
}

/* ---- Abstract ---- */
.abstract-text {
  font-size: 1rem;
  color: var(--text);
  line-height: 1.85;
  margin-bottom: 1rem;
  text-align: justify;
}

/* ---- Method Cards ---- */
.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.method-card {
  background: white;
  border-radius: 12px;
  padding: 1.75rem 1.5rem;
  border: 1px solid var(--border);
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.method-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.method-icon {
  font-size: 1.8rem;
  color: var(--blue);
  margin-bottom: 0.75rem;
}

.method-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 0.5rem;
}

.method-card p {
  font-size: 0.85rem;
  color: var(--gray);
  line-height: 1.6;
}

/* ---- Pipeline figure ---- */
.pipeline-figure img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
}

/* ---- Stats Grid ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--gray);
  font-weight: 500;
}

/* ---- Task Tags ---- */
.tasks-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.task-tag {
  background: white;
  border: 1.5px solid var(--blue);
  color: var(--blue);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.task-tag:hover {
  background: var(--blue);
  color: white;
}

/* ---- Placeholder boxes ---- */
.teaser-placeholder,
.pipeline-placeholder,
.results-placeholder {
  background: white;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--gray);
}

.teaser-placeholder i,
.pipeline-placeholder i,
.results-placeholder i {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
  opacity: 0.3;
}

.teaser-placeholder p,
.pipeline-placeholder p,
.results-placeholder p {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.teaser-placeholder span,
.pipeline-placeholder span,
.results-placeholder span {
  font-size: 0.85rem;
  font-family: 'Source Code Pro', monospace;
  opacity: 0.6;
}

/* ---- Qualitative Results ---- */
.qual-item {
  margin-bottom: 3.5rem;
}

.qual-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--heading);
  margin-bottom: 0.4rem;
}

.qual-desc {
  font-size: 0.95rem;
  color: var(--gray);
  margin-bottom: 1rem;
}

.qual-img {
  width: 100%;
  max-width: 900px;
  display: block;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0,0,0,0.07);
}

/* ---- Results Table ---- */
.results-table-wrap {
  overflow-x: auto;
  margin-top: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  background: white;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.results-table th,
.results-table td {
  padding: 0.65rem 0.85rem;
  text-align: center;
  border-bottom: 1px solid #f1f5f9;
}

/* Single header row */
.results-table thead th {
  background: #0f172a;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.8rem 0.85rem;
  border-bottom: none;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.results-table thead th:first-child {
  text-align: left;
  padding-left: 1.2rem;
  text-transform: none;
  color: #e2e8f0;
  font-size: 0.82rem;
  letter-spacing: 0;
}

.results-table .model-name {
  text-align: left;
  font-size: 0.82rem;
  white-space: nowrap;
  padding-left: 1.2rem;
  min-width: 240px;
  color: var(--heading);
  background: white;
}

.results-table tbody tr {
  transition: background 0.12s;
}

.results-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.results-table tbody tr:hover td {
  background: #eef2ff !important;
}

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

.results-table .section-divider td {
  border-top: 2px solid #e2e8f0;
}

.results-table .ours-row td.model-name {
  color: var(--blue);
}

.results-table .rank1 {
  background: #fef2f2 !important;
  color: #b91c1c;
  font-weight: 700;
}

.results-table .rank2 {
  background: #fffbeb !important;
  color: #b45309;
  font-weight: 500;
}

/* ---- Innovation Cards (inline in Key Innovations) ---- */
.innovation-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}

.innovation-card + .innovation-card {
  margin-top: 1.5rem;
}

/* ---- Citation ---- */
.citation-box {
  position: relative;
  background: #0f172a;
  border-radius: 12px;
  padding: 1.75rem;
  margin-top: 1.5rem;
}

.citation-box pre {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.copy-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: #334155;
  color: #cbd5e1;
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: #475569;
}

.copy-btn.copied {
  background: #059669;
  color: white;
}

/* ---- Footer ---- */
.footer {
  background: #0f172a;
  color: #94a3b8;
  text-align: center;
  padding: 2.5rem 0;
  font-size: 0.9rem;
}

.footer a {
  color: #93c5fd;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer-note {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .paper-title { font-size: 1.5rem; }
  .section { padding: 3rem 0; }
  .method-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .paper-title { font-size: 1.3rem; }
  .method-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
