/* Academic Project Page Styles for Zatom-2 */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #059669;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --bg-light: #f8fafc;
  --border-color: #e2e8f0;
  --card-bg: #ffffff;
  --accent-purple: #7c3aed;
  --accent-amber: #d97706;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-dark);
  background-color: #ffffff;
  line-height: 1.6;
}

.hero .title {
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.hero .subtitle {
  font-weight: 400;
  color: var(--text-muted);
}

.publication-title {
  font-size: 2.25rem !important;
  margin-bottom: 1.25rem !important;
}

.publication-authors {
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
}

.author-block {
  display: inline-block;
  margin-right: 0.4rem;
  margin-bottom: 0.35rem;
}

.author-block a {
  color: #1d4ed8;
  font-weight: 600;
  text-decoration: none;
}

.author-block a:hover {
  text-decoration: underline;
}

.contribution-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  vertical-align: middle;
  margin-left: 0.25rem;
  margin-right: 0.15rem;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.contribution-pill.lead {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.contribution-pill.senior {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.contribution-pill.comp {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.author-notes {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.publication-affiliations {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.6;
}

.publication-links {
  margin-top: 1rem;
}

.publication-links .button {
  margin: 0.25rem;
  font-weight: 600;
  border-radius: 9999px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.publication-links .button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.12);
}

/* MolStar Viewer Section */
.molstar-section {
  background: var(--bg-light);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  padding: 3rem 1.5rem;
}

.molstar-container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  overflow: hidden;
  max-width: 1040px;
  margin: 0 auto;
}

.viewer-header {
  padding: 1rem 1.5rem;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.domain-tabs {
  display: flex;
  gap: 0.5rem;
}

.domain-tab-btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.domain-tab-btn:hover {
  background: #e2e8f0;
}

.domain-tab-btn.is-active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.viewer-frame-container {
  position: relative;
  width: 100%;
  height: 520px;
  background: #ffffff;
}

#molstar-app {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.viewer-overlay-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 0.5rem 0.85rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(226, 232, 240, 0.8);
  font-size: 0.85rem;
  pointer-events: none;
}

.viewer-overlay-badge .badge-title {
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.viewer-overlay-badge .badge-info {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.15rem;
}

.loading-spinner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 20;
  transition: opacity 0.3s ease;
}

.loading-spinner-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

/* Custom Player Controls Bar */
.player-controls {
  padding: 1.25rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
}

.controls-row-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.playback-buttons {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ctrl-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ctrl-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.ctrl-btn.play-btn,
.ctrl-btn.is-active {
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
}

.ctrl-btn.play-btn:hover,
.ctrl-btn.is-active:hover {
  background: var(--primary-hover);
}

.timeline-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.timeline-slider {
  flex-grow: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #cbd5e1;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

.timeline-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.1s;
}

.timeline-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.timeline-label {
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 90px;
  text-align: right;
}

.controls-row-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
}

.button-group-pills {
  display: inline-flex;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  background: #ffffff;
}

.pill-btn {
  padding: 0.35rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-dark);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-btn:not(:last-child) {
  border-right: 1px solid var(--border-color);
}

.pill-btn:hover {
  background: #f1f5f9;
}

.pill-btn.is-active {
  background: var(--primary-color);
  color: #ffffff;
}

.player-info-card {
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.player-info-card a {
  color: var(--primary-color);
  font-weight: 500;
  text-decoration: underline;
  word-break: break-all;
}

.player-info-card a:hover {
  color: var(--primary-hover);
}

/* Fullscreen styles for MolStar container */
.molstar-container:fullscreen,
.molstar-container:-webkit-full-screen,
.molstar-container.is-fullscreen {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: none !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  background: #ffffff !important;
  z-index: 99999 !important;
  box-sizing: border-box !important;
}

.molstar-container.is-fullscreen {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}

.molstar-container:fullscreen .viewer-header,
.molstar-container:-webkit-full-screen .viewer-header,
.molstar-container.is-fullscreen .viewer-header {
  flex-shrink: 0;
  z-index: 10;
  border-radius: 0;
}

.molstar-container:fullscreen .viewer-frame-container,
.molstar-container:-webkit-full-screen .viewer-frame-container,
.molstar-container.is-fullscreen .viewer-frame-container {
  flex: 1 1 auto;
  height: 100% !important;
  min-height: 0 !important;
  position: relative;
}

.molstar-container:fullscreen .player-controls,
.molstar-container:-webkit-full-screen .player-controls,
.molstar-container.is-fullscreen .player-controls {
  flex-shrink: 0;
  z-index: 10;
}

.molstar-container:fullscreen .player-info-card,
.molstar-container:-webkit-full-screen .player-info-card,
.molstar-container.is-fullscreen .player-info-card {
  flex-shrink: 0;
  padding: 0.6rem 1.5rem;
}

/* Sections */
.section-title {
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem !important;
  text-align: center;
  line-height: 1.3;
}

.title:not(.is-spaced) + .subtitle,
.title + .subtitle,
.section-title + .subtitle {
  margin-top: 0.85rem !important;
  margin-bottom: 2rem !important;
  line-height: 1.6 !important;
}

/* Benchmark Tables */
.benchmark-table-container {
  overflow-x: auto;
  margin-top: 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.benchmark-table {
  width: 100%;
  font-size: 0.875rem;
  border-collapse: collapse;
  background: #ffffff;
}

.benchmark-table th {
  background-color: #f8fafc;
  color: #1e293b;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 2px solid #e2e8f0;
  text-align: right;
  white-space: nowrap;
}

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

.benchmark-table td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: right;
  white-space: nowrap;
}

.benchmark-table td:first-child {
  text-align: left;
  font-weight: 500;
}

.benchmark-table tr.highlight-row {
  background-color: #eff6ff;
  font-weight: 600;
}

.benchmark-table tr.highlight-row td:first-child {
  color: #1d4ed8;
}

.benchmark-table tr.subhead-row td {
  background-color: #f1f5f9;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.5rem 1rem;
  text-align: left;
}

.feature-card {
  height: 100%;
  padding: 1.5rem;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

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

.feature-icon.blue {
  background: #eff6ff;
  color: var(--primary-color);
}

.feature-icon.green {
  background: #ecfdf5;
  color: var(--secondary-color);
}

.feature-icon.purple {
  background: #f5f3ff;
  color: var(--accent-purple);
}

.feature-icon.amber {
  background: #fffbeb;
  color: var(--accent-amber);
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

/* Images & Figures */
.figure-container {
  text-align: center;
  margin: 1.5rem 0;
}

.figure-image {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.figure-caption {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.4;
  text-align: left;
}

/* Tabs inside results section */
.results-tabs {
  margin-bottom: 1.5rem;
}

.results-tab-content {
  display: none;
}

.results-tab-content.is-active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* BibTeX */
.bibtex-box {
  background: #0f172a;
  color: #f8fafc;
  padding: 1.5rem;
  border-radius: 8px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
}

.bibtex-box pre {
  background: transparent !important;
  color: #f1f5f9 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  font-family: inherit;
  font-size: inherit;
  line-height: 1.6;
  white-space: pre;
  overflow-x: visible;
}

.bibtex-box pre code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  font-family: inherit;
  font-size: inherit;
}

.copy-bibtex-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.copy-bibtex-btn:hover {
  background: #334155;
  border-color: #94a3b8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.copy-bibtex-btn:active {
  transform: translateY(0);
}

.copy-bibtex-btn.is-success {
  background: #059669 !important;
  border-color: #10b981 !important;
  color: #ffffff !important;
}

footer {
  background: #f8fafc;
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Gallery Zoom & Lightbox Modal */
.gallery-zoomable {
  position: relative;
  cursor: zoom-in;
  overflow: hidden;
}

.gallery-zoomable img {
  transition: transform 0.25s ease;
  display: block;
  width: 100%;
}

.gallery-zoomable:hover img {
  transform: scale(1.02);
}

.gallery-zoomable .zoom-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.gallery-zoomable:hover .zoom-overlay {
  opacity: 1;
}

/* Specific styling for figures inside .figure-container wrapped with .figure-zoomable */
.figure-container .figure-zoomable {
  display: inline-block;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  line-height: 0;
  vertical-align: middle;
}

.figure-container .figure-zoomable img {
  display: inline-block;
  width: auto;
  max-width: 100%;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.figure-container .figure-zoomable .zoom-overlay {
  border-radius: 7px;
}

.gallery-modal-content {
  max-width: 90vw !important;
  width: auto !important;
  max-height: 94vh !important;
  margin: 0 auto;
}

.gallery-modal-box {
  background: #ffffff;
  border-radius: 12px;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.modal-close-custom {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
  transition: background 0.2s ease;
}

.modal-close-custom:hover {
  background: rgba(15, 23, 42, 0.95);
}

