/**
 * Shared Paper Page Styles
 * Minimalist academic: compact, flat, no boxes
 */

/* ===== Layout ===== */
.paper-container {
  line-height: 1.7;
}

/* ===== Back Link ===== */
.back-link {
  margin-bottom: 24px;
}

.back-link a {
  color: #6b7280;
  text-decoration: none;
  font-weight: 500;
  font-size: 14px;
}

.back-link a:hover {
  color: #1a1a1a;
}

/* ===== Title & Meta ===== */
.paper-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  line-height: 1.3;
  color: #1a1a1a;
}

.paper-authors {
  font-size: 16px;
  color: #4b5563;
  margin-bottom: 4px;
  line-height: 1.5;
}

.paper-venue {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 16px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ===== TL;DR ===== */
.paper-tldr {
  background: none;
  border: none;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 0;
  margin-bottom: 24px;
}

.paper-tldr .tldr-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #9ca3af;
  margin-bottom: 4px;
}

.paper-tldr p {
  font-size: 14px;
  color: #374151;
  margin: 0;
  line-height: 1.6;
}

/* ===== Links ===== */
.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 24px;
}

.paper-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: none;
  color: #1a1a1a;
  text-decoration: none;
  border: 1px solid #d1d5db;
  font-size: 13px;
  font-weight: 500;
}

.paper-links a:hover {
  border-color: #1a1a1a;
}

.paper-links a svg {
  width: 13px;
  height: 13px;
}

/* ===== Stat Cards ===== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  margin: 20px 0;
  border: 1px solid #e5e7eb;
  background: #e5e7eb;
}

.stat-card {
  background: #fff;
  padding: 14px 12px;
  text-align: center;
}

.stat-card .stat-value {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
  margin-bottom: 2px;
}

.stat-card .stat-label {
  font-size: 11px;
  color: #6b7280;
  font-weight: 400;
}

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

.paper-figure img {
  max-width: 480px;
  width: 100%;
  border: 1px solid #e5e7eb;
}

.paper-figure figcaption {
  font-size: 12px;
  color: #6b7280;
  margin-top: 8px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

/* ===== Story Sections ===== */
.story-section {
  margin-bottom: 24px;
}

.story-section h2 {
  font-size: 18px;
  color: #1a1a1a;
  margin-bottom: 8px;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 4px;
}

.story-section p {
  color: #374151;
  margin-bottom: 10px;
  text-align: justify;
  font-size: 14px;
}

/* ===== Highlight / Concept / Note — plain text, no boxes ===== */
.highlight-box,
.concept-box,
.note-box {
  background: none;
  padding: 0;
  margin: 20px 0;
  border: none;
  border-left: none;
}

.highlight-box h3,
.concept-box h3,
.note-box h3 {
  margin: 0 0 6px;
  color: #1a1a1a;
  font-size: 16px;
  font-weight: 600;
}

.highlight-box ul {
  margin-bottom: 0;
  padding-left: 20px !important;
}

.highlight-box li {
  margin-bottom: 4px !important;
  color: #374151;
  line-height: 1.6;
  font-size: 14px;
}

.highlight-box p,
.concept-box p,
.note-box p {
  color: #374151;
  margin-bottom: 0;
  line-height: 1.6;
  font-size: 14px;
}

/* ===== Results Table ===== */
.results-table-wrapper {
  margin: 20px 0;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.results-table-wrapper h3 {
  margin: 0;
  padding: 10px 14px;
  background: #f9fafb;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  border-bottom: 1px solid #e5e7eb;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.results-table thead th {
  background: #f9fafb;
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #d1d5db;
  white-space: nowrap;
}

.results-table tbody td {
  padding: 7px 12px;
  border-bottom: 1px solid #f3f4f6;
  color: #4b5563;
}

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

.results-table .highlight-row {
  background: #f5f7f5;
  font-weight: 600;
}

.results-table .highlight-row td {
  color: #1a1a1a;
}

.results-table .best-value {
  font-weight: 700;
}

/* ===== Abstract Expandable ===== */
.paper-abstract {
  margin: 16px 0;
}

.abstract-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid #d1d5db;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 500;
  color: #4b5563;
  cursor: pointer;
}

.abstract-toggle-btn:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

.abstract-toggle-btn .chevron {
  width: 12px;
  height: 12px;
}

.abstract-toggle-btn.expanded .chevron {
  transform: rotate(180deg);
}

.abstract-content {
  max-height: 0;
  overflow: hidden;
}

.abstract-content.expanded {
  max-height: 1000px;
}

.abstract-content p {
  margin-top: 10px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.7;
  text-align: justify;
}

/* ===== Citation Block ===== */
.paper-citation-wrapper {
  margin-top: 32px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.citation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.citation-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.copy-citation-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid #d1d5db;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  cursor: pointer;
}

.copy-citation-btn:hover {
  border-color: #1a1a1a;
  color: #1a1a1a;
}

.copy-citation-btn.copied {
  border-color: #166534;
  color: #166534;
}

.paper-citation {
  padding: 12px 14px;
  font-family: 'SF Mono', 'Monaco', 'Menlo', 'Consolas', monospace;
  font-size: 11.5px;
  overflow-x: auto;
  white-space: pre-wrap;
  margin: 0;
  background: #fff;
  color: #374151;
  line-height: 1.5;
}

/* ===== Animations (disabled) ===== */
.fade-in-section {
  opacity: 1;
  transform: none;
}

/* ===== Section Divider ===== */
.section-divider {
  width: 100%;
  height: 1px;
  background: #e5e7eb;
  margin: 28px 0;
}

/* ===== Two Column Layout ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 20px 0;
}

/* ===== Method Steps ===== */
.method-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 20px 0;
  border-left: 1px solid #d1d5db;
  padding-left: 20px;
}

.method-step {
  display: flex;
  gap: 12px;
  padding: 8px 0;
}

.step-number {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: none;
  color: #1a1a1a;
  border: 1.5px solid #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.step-content h4 {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}

.step-content p {
  margin: 0;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.55;
}

/* ===== Dark Mode ===== */
[data-theme="dark"] .paper-title { color: var(--text-color); }
[data-theme="dark"] .paper-authors { color: #b8b8b8; }
[data-theme="dark"] .paper-venue { color: #888; }
[data-theme="dark"] .back-link a { color: #888; }
[data-theme="dark"] .back-link a:hover { color: var(--text-color); }

[data-theme="dark"] .paper-tldr {
  border-color: #374151;
}
[data-theme="dark"] .paper-tldr .tldr-label { color: #888; }
[data-theme="dark"] .paper-tldr p { color: var(--text-color); }

[data-theme="dark"] .paper-links a {
  color: var(--text-color);
  border-color: #4b5563;
}
[data-theme="dark"] .paper-links a:hover {
  border-color: var(--text-color);
}

[data-theme="dark"] .stat-cards {
  border-color: #374151;
  background: #374151;
}
[data-theme="dark"] .stat-card {
  background: var(--section-bg);
}
[data-theme="dark"] .stat-card .stat-value { color: var(--text-color); }
[data-theme="dark"] .stat-card .stat-label { color: #9ca3af; }

[data-theme="dark"] .story-section h2 {
  color: var(--text-color);
  border-bottom-color: #374151;
}
[data-theme="dark"] .story-section p { color: var(--text-color); }

[data-theme="dark"] .paper-figure img {
  border-color: #374151;
}
[data-theme="dark"] .paper-figure figcaption { color: #9ca3af; }

[data-theme="dark"] .highlight-box h3,
[data-theme="dark"] .concept-box h3,
[data-theme="dark"] .note-box h3 { color: var(--text-color); }
[data-theme="dark"] .highlight-box li,
[data-theme="dark"] .highlight-box p,
[data-theme="dark"] .concept-box p,
[data-theme="dark"] .note-box p { color: var(--text-color); }

[data-theme="dark"] .results-table-wrapper {
  border-color: #374151;
}
[data-theme="dark"] .results-table-wrapper h3 {
  background: #252525;
  color: var(--text-color);
  border-bottom-color: #374151;
}
[data-theme="dark"] .results-table thead th {
  background: #252525;
  color: #d1d5db;
  border-bottom-color: #4b5563;
}
[data-theme="dark"] .results-table tbody td {
  color: #d1d5db;
  border-bottom-color: #2a2a2a;
}
[data-theme="dark"] .results-table .highlight-row {
  background: #1e2a1e;
}
[data-theme="dark"] .results-table .highlight-row td {
  color: var(--text-color);
}

[data-theme="dark"] .paper-citation-wrapper {
  border-color: #374151;
}
[data-theme="dark"] .citation-header {
  background: #252525;
  border-bottom-color: #374151;
}
[data-theme="dark"] .citation-header h3 { color: var(--text-color); }
[data-theme="dark"] .copy-citation-btn {
  color: #9ca3af;
  border-color: #4b5563;
}
[data-theme="dark"] .copy-citation-btn:hover {
  color: var(--text-color);
  border-color: var(--text-color);
}
[data-theme="dark"] .paper-citation {
  background: var(--section-bg);
  color: var(--text-color);
}

[data-theme="dark"] .abstract-toggle-btn {
  color: #9ca3af;
  border-color: #4b5563;
}
[data-theme="dark"] .abstract-toggle-btn:hover {
  color: var(--text-color);
  border-color: var(--text-color);
}
[data-theme="dark"] .abstract-content p {
  color: #d1d5db;
}

[data-theme="dark"] .section-divider {
  background: #374151;
}

[data-theme="dark"] .step-number {
  color: var(--text-color);
  border-color: var(--text-color);
}
[data-theme="dark"] .step-content h4 { color: var(--text-color); }
[data-theme="dark"] .step-content p { color: #d1d5db; }
[data-theme="dark"] .method-steps {
  border-left-color: #4b5563;
}

/* ===== Responsive ===== */
@media screen and (max-width: 768px) {
  .paper-title {
    font-size: 22px;
  }

  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .two-col {
    grid-template-columns: 1fr;
  }

}

@media screen and (max-width: 480px) {
  .stat-cards {
    grid-template-columns: 1fr;
  }

  .paper-title {
    font-size: 20px;
  }

  .paper-links {
    flex-direction: column;
  }

  .paper-links a {
    text-align: center;
    justify-content: center;
  }
}
