/* ===== CSS Variables ===== */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

/* ===== Global Styles ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  line-height: 1.6;
  background: var(--bg-light);
}

/* Image Loading Optimization */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

img[loading="lazy"] {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  min-height: 100px;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

img[loading="lazy"].loaded {
  animation: none;
  background: transparent;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
}

h2 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 80px 0 60px;
  text-align: center;
}

.title {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 2rem;
  opacity: 0.95;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.authors {
  margin: 2rem 0 1rem;
  font-size: 1.1rem;
}

.author {
  display: inline-block;
  margin: 0 0.75rem;
  font-weight: 500;
}

.author sup {
  margin-left: 2px;
}

.affiliations {
  margin-bottom: 2.5rem;
  font-size: 0.95rem;
  opacity: 0.9;
}

.affiliation {
  display: inline-block;
  margin: 0 1rem;
}

.links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 12px 24px;
  background: white;
  color: var(--primary-color);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
  box-shadow: var(--shadow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: #f9fafb;
}

/* ===== Section Styles ===== */
.section {
  padding: 60px 0;
  background: var(--bg-white);
  margin: 20px 0;
}

.section:nth-child(even) {
  background: var(--bg-light);
}

.abstract-section {
  background: white;
}

.abstract-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 900px;
  margin: 0 auto;
  text-align: justify;
}

/* ===== Method Section ===== */
.method-content {
  max-width: 900px;
  margin: 0 auto;
}

.method-image {
  width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

.method-description {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.method-steps {
  list-style: none;
  counter-reset: step-counter;
  padding-left: 0;
}

.method-steps li {
  counter-increment: step-counter;
  margin-bottom: 1.5rem;
  padding-left: 3rem;
  position: relative;
  font-size: 1.05rem;
  color: var(--text-secondary);
}

.method-steps li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  background: var(--primary-color);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
}

/* ===== Findings Section ===== */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.finding-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.finding-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.finding-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.finding-card h3 {
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.finding-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== Variant Overview Styles ===== */
.variant-overview {
  margin-top: 3rem;
  padding: 2rem;
  background: var(--bg-light);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.variant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.variant-item {
  padding: 1rem;
  background: white;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: all 0.2s;
}

.variant-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary-color);
}

.variant-item strong {
  color: var(--primary-color);
  font-size: 1rem;
  display: block;
}

.variant-item p {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===== Results Section ===== */
.result-block {
  margin: 3rem 0;
}

.result-block h3 {
  margin-bottom: 2rem;
  text-align: center;
  color: var(--text-primary);
}

.result-intro {
  text-align: center;
  color: var(--text-secondary);
  max-width: 800px;
  margin: 0 auto 2rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.image-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.single-image {
  max-width: 900px;
  margin: 0 auto;
}

.result-image img,
.single-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  transition: transform 0.3s;
}

.result-image img:hover,
.single-image img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-lg);
}

.caption {
  text-align: center;
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-style: italic;
}

/* ===== PDF Viewer Styles ===== */
.pdf-container {
  width: 100%;
  max-width: 1000px;
  margin: 2rem auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: white;
}

.pdf-viewer {
  width: 100%;
  height: 600px;
  border: none;
  display: block;
}

.pdf-caption {
  text-align: center;
  padding: 1rem;
  background: var(--bg-light);
  margin: 0;
  border-top: 1px solid var(--border-color);
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.pdf-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.pdf-link i {
  font-size: 0.85rem;
}

/* ===== Citation Section ===== */
.citation-section {
  background: var(--bg-light);
}

.bibtex-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.bibtex-container pre {
  background: #1f2937;
  color: #e5e7eb;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  line-height: 1.6;
}

.bibtex-container code {
  font-family: var(--font-mono);
}

.copy-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 8px 16px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: var(--primary-hover);
}

/* ===== Footer ===== */
.footer {
  background: #1f2937;
  color: white;
  padding: 2rem 0;
  text-align: center;
  margin-top: 3rem;
}

.footer p {
  margin: 0;
  opacity: 0.8;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .title {
    font-size: 2.5rem;
  }
  
  .subtitle {
    font-size: 1.2rem;
  }
  
  .author {
    display: block;
    margin: 0.5rem 0;
  }
  
  .image-grid,
  .image-grid-3 {
    grid-template-columns: 1fr;
  }
  
  .findings-grid {
    grid-template-columns: 1fr;
  }
  
  .pdf-viewer {
    height: 400px;
  }
}
