/* ===== HiCAD Academic Website — Custom Styles ===== */

:root {
  --primary: #1a56e8;
  --primary-dark: #0d3abf;
  --accent: #00c9a7;
  --accent2: #ff6b35;
  --bg-dark: #0a0f1e;
  --bg-card: #111827;
  --bg-section: #f8faff;
  --text-main: #1c2333;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --code-bg: #f1f5f9;
}

/* ===== Base ===== */
html { scroll-behavior: smooth; }

body {
  font-family: 'Source Serif 4', 'Georgia', serif;
  color: var(--text-main);
  background: #fff;
  overflow-x: hidden;
}

/* ===== Navbar ===== */
.navbar {
  background: rgba(255,255,255,0.95) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 20px rgba(0,0,0,0.07);
}

.navbar-item {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.875rem;
  color: var(--text-main) !important;
  letter-spacing: 0.01em;
}

.navbar-item:hover { color: var(--primary) !important; }

.conference-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 4px;
  margin-right: 8px;
}

/* ===== Hero ===== */
.hero-section {
  background: var(--bg-dark);
  padding: 80px 0 60px;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 80% 60% at 20% 50%, rgba(26,86,232,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(0,201,167,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.hero-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

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

.publication-title {
  font-family: 'Source Serif 4', serif;
  font-size: 2.4rem !important;
  font-weight: 700;
  line-height: 1.2;
  color: #fff !important;
  letter-spacing: -0.02em;
  max-width: 860px;
  margin: 0 auto 28px;
}

.publication-title .highlight {
  background: linear-gradient(90deg, #60a5fa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.publication-authors {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem;
  color: #cbd5e1;
  margin-bottom: 8px;
}

.publication-authors a {
  color: #93c5fd;
  text-decoration: none;
  border-bottom: 1px solid rgba(147,197,253,0.3);
  transition: border-color 0.2s;
}

.publication-authors a:hover { border-color: #93c5fd; }

.publication-venue {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: #94a3b8;
  margin-bottom: 36px;
}

.equal-contrib {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 4px;
  font-style: italic;
  font-family: 'DM Sans', sans-serif;
}

/* ===== Action Buttons ===== */
.publication-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 32px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  border: 1.5px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
}

.link-btn-primary {
  background: var(--primary);
  color: white !important;
  border-color: var(--primary);
}

.link-btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,86,232,0.4);
  color: white !important;
}

.link-btn-secondary {
  background: rgba(255,255,255,0.08);
  color: #e2e8f0 !important;
}

.link-btn-secondary:hover {
  background: rgba(255,255,255,0.16);
  transform: translateY(-2px);
  color: white !important;
}

/* ===== Teaser ===== */
.teaser-section {
  background: var(--bg-dark);
  padding: 0 0 60px;
  position: relative;
  z-index: 1;
}

.teaser-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 32px;
  backdrop-filter: blur(8px);
}

.teaser-caption {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.92rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 20px;
  line-height: 1.6;
}

/* ===== Stat Numbers ===== */
.stats-bar {
  background: linear-gradient(135deg, var(--primary) 0%, #0d3abf 100%);
  padding: 40px 0;
}

.stat-item {
  text-align: center;
  padding: 0 20px;
}

.stat-number {
  font-family: 'DM Sans', sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
  display: block;
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.75);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ===== Section Base ===== */
.section-paper {
  padding: 80px 0;
}

.section-paper.alt-bg {
  background: var(--bg-section);
}

.section-paper.dark-bg {
  background: var(--bg-dark);
  color: #e2e8f0;
}

.section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 28px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.dark-bg .section-title { color: #f1f5f9; }
.dark-bg .section-title::before { background: var(--accent); }

.section-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 48px;
}

/* ===== Abstract ===== */
.abstract-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 48px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.06);
  position: relative;
  overflow: hidden;
}

.abstract-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.abstract-text {
  font-size: 1.05rem;
  line-height: 1.85;
  color: #334155;
}

/* ===== Challenges ===== */
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 32px;
}

.challenge-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 24px;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.challenge-card::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transform: scaleX(0);
  transition: transform 0.3s;
}

.challenge-card:hover { 
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

.challenge-card:hover::before { transform: scaleX(1); }

.challenge-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  font-size: 1.3rem;
}

.challenge-icon.c1 { background: rgba(26,86,232,0.1); color: var(--primary); }
.challenge-icon.c2 { background: rgba(0,201,167,0.1); color: var(--accent); }
.challenge-icon.c3 { background: rgba(255,107,53,0.1); color: var(--accent2); }

.challenge-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.challenge-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== Method Pipeline ===== */
.pipeline-wrapper {
  background: white;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 4px 40px rgba(0,0,0,0.06);
}

.stage-box {
  background: var(--bg-section);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  position: relative;
  transition: all 0.3s;
}

.stage-box:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(26,86,232,0.07);
}

.stage-badge {
  display: inline-block;
  background: var(--primary);
  color: white;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 12px;
}

.stage-badge.sarl { background: var(--accent); }

.stage-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.stage-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.task-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.task-pill {
  background: rgba(26,86,232,0.08);
  color: var(--primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(26,86,232,0.15);
}

.arrow-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
}

/* ===== Reward Components ===== */
.reward-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.reward-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 20px;
}

.reward-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.reward-formula {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(0,201,167,0.08);
  padding: 6px 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  display: block;
}

.reward-desc {
  font-size: 0.83rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* ===== Dataset ===== */
.dataset-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 40px;
}

.dataset-stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}

.ds-number {
  font-family: 'DM Sans', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  display: block;
  line-height: 1;
  margin-bottom: 6px;
}

.ds-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.modality-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.modality-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: all 0.3s;
}

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

.modality-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.modality-name {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.modality-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Results Table ===== */
.results-table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
}

.results-table thead tr {
  background: var(--bg-dark);
  color: white;
}

.results-table thead th {
  padding: 12px 14px;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-align: center;
  white-space: nowrap;
}

.results-table thead th.method-col {
  text-align: left;
  min-width: 130px;
}

.results-table thead .task-header {
  background: rgba(255,255,255,0.07);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
  color: #94a3b8;
}

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

.results-table tbody tr:hover {
  background: rgba(26,86,232,0.04);
}

.results-table tbody td {
  padding: 10px 14px;
  text-align: center;
  border-top: 1px solid #f1f5f9;
  color: var(--text-main);
}

.results-table tbody td.method-col {
  text-align: left;
  font-weight: 600;
}

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

.results-table .our-row {
  background: linear-gradient(135deg, rgba(26,86,232,0.06), rgba(0,201,167,0.04)) !important;
}

.results-table .our-row td {
  font-weight: 700;
  color: var(--primary);
}

.results-table .our-row td.method-col {
  color: var(--primary);
}

.best-val {
  background: rgba(0,201,167,0.12);
  color: #0d9488;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 5px;
}

.second-val {
  text-decoration: underline;
  text-decoration-style: dotted;
}

.method-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
  font-weight: 500;
}

.tag-general {
  background: rgba(107,114,128,0.1);
  color: #6b7280;
}

.tag-specialized {
  background: rgba(26,86,232,0.1);
  color: var(--primary);
}

/* ===== Ablation ===== */
.ablation-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
}

.ablation-table th {
  background: #1e293b;
  color: white;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.8rem;
  text-align: center;
}

.ablation-table th:first-child { text-align: left; }

.ablation-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.ablation-table td:first-child { text-align: left; font-weight: 600; }

.ablation-table tr:last-child td {
  background: rgba(26,86,232,0.06);
  font-weight: 700;
  color: var(--primary);
}

.ablation-table .highlight-cell {
  color: #0d9488;
  font-weight: 700;
}

/* ===== BibTeX ===== */
.bibtex-block {
  background: #1e293b;
  border-radius: 12px;
  padding: 32px;
  position: relative;
}

.bibtex-block pre {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.8;
  white-space: pre-wrap;
  margin: 0;
}

.bibtex-block .bib-key { color: #60a5fa; }
.bibtex-block .bib-field { color: #34d399; }
.bibtex-block .bib-value { color: #fbbf24; }

.copy-btn {
  position: absolute;
  top: 16px; right: 16px;
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  padding: 6px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover { background: rgba(255,255,255,0.2); }

/* ===== Footer ===== */
.footer-custom {
  background: var(--bg-dark);
  padding: 40px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.footer-text {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
  line-height: 1.7;
}

.footer-text a {
  color: #94a3b8;
  text-decoration: none;
  border-bottom: 1px solid rgba(148,163,184,0.3);
  transition: border-color 0.2s;
}

.footer-text a:hover { border-color: #94a3b8; color: #cbd5e1; }

/* ===== Comparison Visual ===== */
.comparison-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
}

/* ===== Animated Counter ===== */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.stat-number { animation: countUp 0.6s ease forwards; }

/* ===== Scroll animations ===== */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .publication-title { font-size: 1.6rem !important; }
  .challenge-grid { grid-template-columns: 1fr; }
  .reward-grid { grid-template-columns: 1fr; }
  .dataset-stats { grid-template-columns: repeat(2, 1fr); }
  .modality-grid { grid-template-columns: 1fr; }
  .abstract-box { padding: 24px; }
}

/* ===== Tooltip ===== */
.tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.tooltip-text {
  visibility: hidden;
  background: #1e293b;
  color: #e2e8f0;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 6px;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s;
}

.tooltip-wrapper:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* ===== Method overview SVG placeholder ===== */
.figure-placeholder {
  background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
  border: 2px dashed #c7d2fe;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
  color: #818cf8;
  font-family: 'DM Sans', sans-serif;
  min-height: 200px;
}

.figure-caption {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 16px;
  line-height: 1.6;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.figure-caption strong { color: var(--text-main); }

/* ===== Task cards ===== */
.task-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: all 0.2s;
}

.task-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(26,86,232,0.1);
}

.task-arrow {
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9rem;
  margin: 8px 0;
  display: block;
}

/* ===== Improvements bar ===== */
.improvement-bar-wrap {
  margin: 6px 0;
}

.improvement-bar {
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* ===== Tab section ===== */
.tab-nav {
  display: flex;
  gap: 4px;
  background: var(--bg-section);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 28px;
  width: fit-content;
}

.tab-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tab-content { display: none; }
.tab-content.active { display: block; }




.pipeline-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  border-radius: 12px;
}
