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

html {
  scroll-behavior: smooth;
}

section[id] {
  scroll-margin-top: 2rem;
}

/* Global Styles */
body {
  font-family: "Fira Sans", "Roboto", sans-serif;
  line-height: 1.6;
  color: #eaeaea;
  background:
    radial-gradient(circle at top left, #161616, #02336680 70%),
    radial-gradient(circle at bottom right, #161616, #02336680 70%);
  padding: 20px;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle noise texture overlay */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  z-index: -1;
}

/* Container */
.container {
  max-width: 800px; 
  width: 100%;
  margin: 0 auto;
  padding: 20px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 1.9rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  line-height: 2.9rem;
  text-align: left;
  font-family: "Fira Sans", "DM Serif Text", serif;
}

h2 {
  font-size: 1.8rem;
  /* color: #555; */
  /* margin-top: 40px; */
  /* border-bottom: 2px solid #b5d2d8; */
  padding-bottom: 10px;
  margin-bottom: 20px;
}

h3 {
  margin-bottom: 1rem;
  color: rgba(148, 203, 215, 0.9);
  font-weight: 500;
}

p {
  margin-bottom: 20px;
}

a {
  color: rgb(148, 203, 215);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
  text-decoration: underline;
  color: rgb(178, 223, 235);
}

a:visited {
  color: rgb(130, 185, 197);
}


table {
  width: 100%;
  border-collapse: collapse;
  overflow-x: scroll;
  border-radius: 8px;
  overflow: hidden;
}

table,
th,
td {
  border: 1px solid rgba(148, 203, 215, 0.2);
}

th {
  background: rgba(148, 203, 215, 0.15);
  color: rgb(178, 223, 235);
  font-weight: 500;
}

th,
td {
  padding: 0.5rem 0.4rem;
  transition: background-color 0.2s ease;
}

/* Alternating row colors for table */
table tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.05);
}

table tbody tr:hover {
  background-color: rgba(148, 203, 215, 0.1);
}

.title {
  position: relative;
}

/* DOI Badge */
.doi-badge {
  display: inline-block;
  margin-top: 0.8rem;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.doi-badge img {
  height: 1.4rem;
}

.doi-badge:hover {
  opacity: 0.85;
  transform: translateY(-1px);
}

/* Authors */
.authors {
  margin-top: 2rem;
  margin-bottom: 20px;
  font-size: 1.4rem;
  font-family: "Fira Sans", "Roboto", sans-serif;
  font-weight: normal;
}

.authors a {
  color: inherit;
  font-weight: inherit;
}

.authors a:hover {
  text-decoration: none;
}

.authors sup {
  font-size: 0.8rem;
  vertical-align: super;
}

.affiliations {
  font-size: 0.8rem;
  font-style: italic;
}

/* Links Section */
.links ul {
  display: flex;
}

.links ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0;
  list-style: none;
}

.links li {
  flex: 1;
  text-align: center;
  margin: 10px;
  max-width: 10rem;
}

.links a {
  position: relative;
  background: linear-gradient(135deg, rgba(0, 100, 180, 0.7), rgba(63, 150, 140, 0.7));
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(148, 203, 215, 0.2);
  color: white;
  padding: 12px 18px;
  border-radius: 8px;
  display: block;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.links a::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 80, 160, 0.8), rgba(40, 120, 110, 0.8));
  transition: opacity 0.3s ease;
  opacity: 0;
  z-index: 1;
}

.links a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(148, 203, 215, 0.2);
}

.links a:hover::before {
  opacity: 1;
}

.links a i {
  margin-right: 5px;
  position: relative;
  z-index: 2;
}
.links a span {
  position: relative;
  z-index: 2;
}
/* Image Section */

.img-container {
  position: relative;
}

.img-title {
  position: absolute;
  font-size: 2.4rem;
  max-width: 19.4rem;
  margin-top: 40px;
  line-height: 3rem;
  text-shadow: 0 0 49px #bbdcff66;
  border-bottom: none;
  color: #bbdcff;
  top: -3rem;
  left: 2rem;
}

.img-container > img {
  position: relative; /* Ensure the image is positioned relative to the container */
  left: 50%;
  transform: translateX(-50%);
  width: 150%;
  max-width: 90vw;
}

/* Content Sections */
section {
  margin-bottom: 3.5rem;
  padding-top: 1rem;
}

section h2 {
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  display: inline-block;
}

section h2::after {
  content: "";
  display: block;
  width: 60px;
  height: 2px;
  background: rgb(148, 203, 215);
  margin-top: 0.5rem;
}

#methodology > img {
  width: 100%;
  border-radius: 16px;
}

/* Citation */
.citation-block {
  position: relative;
  margin-bottom: 1.5rem;
}

.citation-block pre {
  font-family: monospace;
  font-size: 0.9rem;
  overflow-x: auto;
  padding: 1.2rem;
  padding-left: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 203, 215, 0.15);
  border-radius: 12px;
  margin: 0;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
  background: rgba(148, 203, 215, 0.15);
  border: 1px solid rgba(148, 203, 215, 0.3);
  color: rgb(148, 203, 215);
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: "Fira Sans", sans-serif;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  background: rgba(148, 203, 215, 0.2);
  border-color: rgba(148, 203, 215, 0.5);
  transform: translateY(-1px);
}

.copy-btn i {
  margin-right: 0.3rem;
}

/* Related Work */
.related-work ul {
  list-style-type: none;
  padding: 0;
}

.related-work ul li {
  margin-bottom: 10px;
}

.related-work ul li a {
  color: #007bff;
  font-weight: bold;
}

.related-work ul li a:hover {
  text-decoration: underline;
}

/* Floating Explore Button */
.floating-explore {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, rgba(0, 100, 180, 0.4), rgba(63, 150, 140, 0.4));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(148, 203, 215, 0.25);
  color: white;
  padding: 0.7rem 1.2rem;
  border-radius: 2rem;
  font-family: "Fira Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.floating-explore:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(148, 203, 215, 0.3);
  text-decoration: none;
  color: white;
}

.floating-explore:visited {
  color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  h1 {
    font-size: 1.7rem;
    line-height: 2rem;
  }

  h2 {
    font-size: 1.5rem;
  }

  .authors {
    font-size: 0.7rem;
    line-height: 0.9rem;
  }

  .doi-badge img {
    height: 1.1rem;
  }

  table {
    font-size: 0.7rem;
  }

  .authors sup {
    font-size: 0.5rem;
  }

  .links ul {
    flex-direction: column;
    align-items: center;
  }

  .links li {
    width: 100%;
    margin: 10px 0;
  }

  .img-title {
    position: relative;
    font-size: 1.8rem;
    max-width: 100%;
    text-align: center;
    left: 50%;
    top: auto;
    transform: translateX(-50%);
    line-height: 2.1rem;
  }

  .img-container > img {
    width: 100%;
    left: auto;
    transform: none;
  }

  .img-container > figcaption {
    font-size: 0.8rem;
  }

  .citation-block pre {
    font-size: 0.6rem;
    padding: 0.8rem;
    padding-left: 1rem;
  }

  .copy-btn {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
  }

  .affiliations {
    font-size: 0.6rem;
  }

  .footer > p {
    font-size: 0.9rem;
  }
}

@media (min-width: 1050px) {
  .img-title {
    top: -1rem;
  }
}

/* ==================== */
/* Table of Contents    */
/* ==================== */

.toc-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 220px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 15vh;
  pointer-events: none;
}

.toc-content {
  pointer-events: auto;
  padding: 1.5rem 1rem 1.5rem 1.5rem;
}

.toc-heading {
  font-family: "Fira Sans", sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(148, 203, 215, 0.6);
  margin-bottom: 1rem;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 0.2rem;
}

.toc-link {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 400;
  color: rgba(234, 234, 234, 0.8);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: all 0.2s ease;
}

.toc-link:hover {
  color: rgb(178, 223, 235);
  background: rgba(148, 203, 215, 0.08);
  text-decoration: none;
}

.toc-link:visited {
  color: rgba(234, 234, 234, 0.8);
}

.toc-link.active {
  color: rgb(148, 203, 215);
  border-left-color: rgb(148, 203, 215);
  background: rgba(148, 203, 215, 0.1);
  font-weight: 500;
}

.toc-link.active:visited {
  color: rgb(148, 203, 215);
}

.toc-toggle {
  display: none;
  pointer-events: auto;
}

/* ToC backdrop overlay */
.toc-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 40;
}

.toc-backdrop.visible {
  display: block;
}

/* Medium screens: collapse to toggle button */
@media (max-width: 1250px) and (min-width: 769px) {
  .toc-sidebar {
    width: 0;
    transition: width 0.3s ease;
  }

  .toc-content {
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
  }

  .toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 60;
    width: 40px;
    height: 40px;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 203, 215, 0.2);
    border-radius: 8px;
    color: rgba(148, 203, 215, 0.8);
    font-size: 1rem;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.2s ease;
  }

  .toc-toggle:hover {
    background: rgba(148, 203, 215, 0.15);
  }

  .toc-sidebar.open {
    width: 220px;
  }

  .toc-sidebar.open .toc-content {
    opacity: 1;
    pointer-events: auto;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 1px solid rgba(148, 203, 215, 0.15);
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
  }
}

/* Mobile: off-screen overlay */
@media (max-width: 768px) {
  .toc-sidebar {
    width: 260px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding-top: 4rem;
    justify-content: flex-start;
  }

  .toc-content {
    background: none;
    border: none;
    border-radius: 0;
  }

  .toc-sidebar.open {
    transform: translateX(0);
  }

  .toc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    width: 40px;
    height: 40px;
    z-index: 60;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(148, 203, 215, 0.25);
    border-radius: 8px;
    color: rgba(148, 203, 215, 0.8);
    font-size: 1rem;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.2s ease;
  }

  .toc-toggle:hover {
    background: rgba(148, 203, 215, 0.15);
  }
}
