/* ===== CSS Variables (Web-SSL Blue Tone) ===== */
:root {
  --primary-color: #2D5F8B;
  --secondary-color: #5E8C61;
  --accent-color: #6366F1;
  --light-color: #FFFFFF;
  --dark-color: #1F2937;
  --text-color: #4B5563;
  --background-color: #FFFFFF;
  --card-background: #FFFFFF;
  --header-gradient: linear-gradient(135deg, #EBF3FA 0%, #FFFFFF 100%);
  --footer-gradient: linear-gradient(135deg, #1F2937 0%, #2D5F8B 100%);
  --nav-gradient: linear-gradient(90deg, #1F2937 0%, #2D5F8B 100%);
  --link-color: var(--primary-color);
  --best-green: #D1FAE5;
  --border-radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
}

/* ===== Base ===== */
* { box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  color: var(--text-color);
  background: var(--background-color);
  line-height: 1.7;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--dark-color);
  font-weight: 700;
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-color); }

img { max-width: 100%; height: auto; }

/* ===== Layout ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 900px; margin: 0 auto; padding: 0 24px; }
.container-citation { max-width: 1100px; }

section {
  padding: 60px 0;
}

section + section {
  border-top: 1px solid #E5E7EB;
}

/* ===== Header ===== */
.header-section {
  background: var(--header-gradient);
  padding: 80px 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header-section::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(45, 95, 139, 0.06) 0%, transparent 50%);
  pointer-events: none;
}

.paper-title {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--dark-color);
  margin-bottom: 8px;
  line-height: 1.3;
}

.paper-title .title-gradient {
  background: linear-gradient(90deg, #E6324C 0%, #6EC5C1 33%, #8A7CCE 66%, #7E2EA2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.paper-venue {
  font-size: 1.1rem;
  color: var(--primary-color);
  font-weight: 700;
  margin-bottom: 24px;
}

.author-line {
  font-size: 1.05rem;
  margin-bottom: 16px;
  line-height: 1.8;
}

.author-link {
  color: var(--dark-color);
  font-weight: 600;
  transition: color 0.2s;
}
.author-link:hover { color: var(--primary-color); }

.author-equal {
  font-size: 0.75em;
  vertical-align: super;
  color: var(--primary-color);
}

.institution-line {
  font-size: 0.95rem;
  color: var(--text-color);
  margin-bottom: 24px;
}

.institution-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.institution-logo-wrapper {
  display: inline-flex;
  align-items: flex-end;
  height: 56px;
  margin: 0 5px;
  position: relative;
}

.institution-logo-wrapper sup {
  position: absolute;
  top: 0;
  left: -10px;
  font-size: 13px;
  color: var(--text-color);
}

.institution-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
  vertical-align: middle;
  opacity: 0.85;
  transition: opacity 0.2s;
}
.institution-logo:hover { opacity: 1; }

.header-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.header-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.btn-primary-custom {
  background: var(--primary-color);
  color: #fff !important;
}
.btn-primary-custom:hover {
  background: #1F4A6F;
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline-custom {
  border: 2px solid var(--primary-color);
  color: var(--primary-color) !important;
  background: transparent;
}
.btn-outline-custom:hover {
  background: var(--primary-color);
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ===== Section Headings ===== */
.section-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--dark-color);
  text-align: center;
  padding-bottom: 10px;
  position: relative;
}

.section-title::after {
  content: "";
  display: block;
  width: 100px;
  height: 3px;
  background-color: var(--secondary-color);
  margin: 10px auto 0;
  border-radius: 2px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-color);
  text-align: center;
  margin-bottom: 36px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== TL;DR ===== */
.tldr-box {
  background: rgba(45, 95, 139, 0.04);
  border-left: 4px solid var(--primary-color);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  padding: 28px 32px;
  margin-bottom: 32px;
}

.tldr-question {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  font-style: italic;
  margin-bottom: 16px;
}

.tldr-answer {
  font-size: 1.02rem;
  line-height: 1.8;
}

.key-findings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.finding-card {
  background: var(--card-background);
  border-radius: var(--border-radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #E5E7EB;
  transition: transform 0.2s, box-shadow 0.2s;
}
.finding-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.finding-card h5 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.finding-card p {
  font-size: 0.92rem;
  margin: 0;
  line-height: 1.6;
}

/* ===== Figures ===== */
.figure-container {
  margin: 32px 0;
  text-align: center;
}

.figure-container img {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.figure-caption {
  font-size: 0.9rem;
  color: #6B7280;
  margin-top: 12px;
  font-style: italic;
}

/* ===== Dataset Cards ===== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.stat-card {
  background: var(--card-background);
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid #E5E7EB;
}

.stat-card .stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-color);
}

.stat-card .stat-label {
  font-size: 0.85rem;
  color: var(--text-color);
  margin-top: 4px;
}

/* ===== Tables ===== */
.table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  white-space: nowrap;
}

.data-table th {
  background: var(--primary-color);
  color: #fff;
  padding: 10px 12px;
  text-align: center;
  font-weight: 700;
  position: sticky;
  top: 0;
}

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

.data-table td {
  padding: 8px 12px;
  text-align: center;
  border-bottom: 1px solid #E5E7EB;
}

.data-table td:first-child {
  text-align: left;
  font-weight: 600;
  color: var(--dark-color);
}

.data-table tbody tr:hover {
  background: rgba(45, 95, 139, 0.04);
}

.data-table .group-header td {
  background: #F3F4F6;
  font-weight: 700;
  font-style: italic;
  color: var(--dark-color);
  border-bottom: 2px solid #D1D5DB;
}

.data-table .best-cell {
  background: var(--best-green);
  font-weight: 700;
}

.table-caption {
  font-size: 0.9rem;
  color: #6B7280;
  margin-top: 10px;
  text-align: center;
}

/* ===== Analysis Toggle / Accordion ===== */
.custom-nav-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  justify-content: center;
}

.custom-nav-pills .nav-link {
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-color);
  background: #F3F4F6;
  border: 1px solid #E5E7EB;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.custom-nav-pills .nav-link:hover {
  background: rgba(45, 95, 139, 0.1);
  color: var(--primary-color);
}

.custom-nav-pills .nav-link.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.research-question {
  margin-bottom: 12px;
  border: 1px solid #E5E7EB;
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.research-question.is-open {
  box-shadow: var(--shadow-sm);
}

.question-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  cursor: pointer;
  transition: background 0.2s;
  user-select: none;
}

.question-header:hover {
  background: rgba(45, 95, 139, 0.04);
}

.question-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-color);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.question-title {
  flex: 1;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--dark-color);
  margin: 0;
}

.question-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-color);
  transition: transform 0.3s;
  font-size: 1rem;
}

.question-toggle .fas {
  transition: transform 0.3s;
  transform: rotate(-90deg);
}

.research-question.is-open .question-toggle .fas {
  transform: rotate(0deg);
}

.question-content {
  padding: 0 24px 24px;
  line-height: 1.8;
}

.question-content p {
  margin-bottom: 16px;
}

.question-content .figure-container {
  margin: 20px 0;
}

/* ===== Qualitative Gallery ===== */
.gallery-wrapper {
  position: relative;
  background: #F9FAFB;
  border-radius: var(--border-radius);
  padding: 24px;
  margin-top: 32px;
}

.gallery-slide {
  display: none;
  text-align: center;
}

.gallery-slide.active {
  display: block;
}

.gallery-slide img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.gallery-slide .slide-caption {
  font-size: 0.9rem;
  color: #6B7280;
  margin-top: 12px;
}

.gallery-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}

.gallery-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s;
}

.gallery-btn:hover {
  background: var(--primary-color);
  color: #fff;
}

.gallery-counter {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-color);
}

/* ===== Citation ===== */
.citation-box {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: var(--border-radius);
  padding: 24px;
  position: relative;
}

.citation-box pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--dark-color);
}

.copy-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid #D1D5DB;
  background: #fff;
  color: var(--text-color);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

.copy-btn.copied {
  background: var(--secondary-color);
  color: #fff;
  border-color: var(--secondary-color);
}

/* ===== Footer ===== */
.footer {
  background: var(--footer-gradient);
  color: rgba(255, 255, 255, 0.85);
  padding: 40px 0;
  text-align: center;
  font-size: 0.92rem;
}

.footer a {
  color: #93C5FD;
}

.footer a:hover {
  color: #BFDBFE;
}

/* ===== Highlight Box ===== */
.highlight-box {
  background: rgba(45, 95, 139, 0.05);
  border-left: 4px solid var(--primary-color);
  border-radius: 0 8px 8px 0;
  padding: 20px 24px;
  margin: 20px 0;
}

/* ===== Metric Cards ===== */
.metric-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 24px 0;
}

.metric-card {
  background: var(--card-background);
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #E5E7EB;
}

.metric-card h5 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 8px;
}

.metric-card p {
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.6;
}

/* ===== Two Column Layout ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* ===== Reward Equation ===== */
.equation-box {
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: var(--border-radius);
  padding: 20px;
  text-align: center;
  font-size: 1.05rem;
  font-family: 'Georgia', serif;
  margin: 20px 0;
}

/* ===== Utility ===== */
.text-primary { color: var(--primary-color) !important; }
.fw-bold { font-weight: 700 !important; }
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
