/* Modern CSS Variables for consistent theming */
:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --accent-color: #0ea5e9;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --background-primary: #ffffff;
  --background-secondary: #f8fafc;
  --background-accent: #f1f5f9;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-subtle: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  --border-radius: 12px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth scrolling for better UX */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 16px;
  background-color: var(--background-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Modern Button Styles */
.button {
  border-radius: var(--border-radius) !important;
  font-weight: 600 !important;
  transition: var(--transition) !important;
  border: 2px solid transparent !important;
  position: relative;
  overflow: hidden;
}

.button.is-dark {
  background: var(--text-primary) !important;
  border: none !important;
  color: white !important;
  box-shadow: var(--shadow-md);
}

.button.is-dark:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  background: var(--primary-color) !important;
}

.button.is-dark:active {
  transform: translateY(0);
  box-shadow: var(--shadow-md);
}

.footer .icon-link {
  font-size: 25px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.footer .icon-link:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.link-block a {
  margin: 8px 4px;
}

.dnerf {
  font-variant: small-caps;
}

/* Hero Section Modernization */
.hero {
  position: relative;
  overflow: hidden;
}

.hero.is-light {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.hero-body {
  padding: 4rem 1.5rem;
}

.teaser .hero-body {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.teaser {
  font-family: 'Inter', sans-serif;
}

/* Acronym highlight in title */
.acr {
  color: #991b1b;
  font-weight: 800;
}

/* Publication Content Styling */
.publication-title {
  font-family: 'Inter', sans-serif !important;
  font-weight: 800 !important;
  color: var(--text-primary) !important;
  margin-bottom: 2rem !important;
  line-height: 1.1 !important;
}

.title-line-2 {
  white-space: nowrap;
}

.publication-banner {
  max-height: 70vh;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  margin: 2rem 0;
}

.publication-banner video {
  position: relative;
  left: auto;
  top: auto;
  transform: none;
  object-fit: cover;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-lg);
}

.publication-header .hero-body {
  padding: 6rem 1.5rem 4rem;
}

.publication-authors {
  font-family: 'Inter', sans-serif !important;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

.publication-venue {
  color: var(--text-secondary);
  width: fit-content;
  font-weight: 600;
  background: var(--background-accent);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  margin-top: 1rem;
  display: inline-block;
}

.publication-awards {
  color: #ef4444;
  width: fit-content;
  font-weight: 700;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  border-left: 4px solid #ef4444;
  margin-top: 1rem;
}

.publication-authors a {
  color: #991b1b !important;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  position: relative;
}

.publication-authors a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background: var(--gradient-accent);
  transition: var(--transition);
}

.publication-authors a:hover::after {
  width: 100%;
}

.publication-authors a:hover {
  color: #7f1d1d !important;
}

.author-block {
  display: inline-block;
  margin-right: 0.5rem;
}

.publication-banner img {
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.publication-banner img:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-xl);
}

/* Modern Video and Carousel Styling */
.publication-video {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  overflow: hidden;
  border-radius: var(--border-radius-lg) !important;
  box-shadow: var(--shadow-xl);
  transition: var(--transition);
}

.publication-video:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.publication-video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--border-radius-lg);
}

.publication-body img {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.publication-body img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Pagination and Misc Improvements */
.slider-pagination .slider-page {
  background: var(--primary-color);
  border-radius: 50%;
  transition: var(--transition);
}

.slider-pagination .slider-page.is-active {
  background: var(--primary-hover);
  transform: scale(1.2);
}

.eql-cntrb {
  font-size: 0.875rem;
  color: var(--text-light);
  font-style: italic;
}

/* Section Titles */
.title.is-3 {
  font-family: 'Inter', sans-serif !important;
  font-weight: 700 !important;
  color: var(--text-primary);
  margin-bottom: 2rem !important;
  position: relative;
  padding-bottom: 1rem;
}

.title.is-3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-accent);
  border-radius: 2px;
}

/* Content Improvements */
.content.has-text-justified {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

.content.has-text-justified p {
  margin-bottom: 1.5rem;
}

/* Footer Improvements */
.footer {
  background: var(--background-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem;
}

.footer .content {
  color: var(--text-secondary);
  line-height: 1.7;
}

.footer a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* BibTeX Styling */
pre {
  background: var(--background-accent) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius) !important;
  padding: 1.5rem !important;
  font-size: 0.9rem !important;
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
}

code {
  background: var(--background-accent) !important;
  color: var(--text-primary) !important;
  font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace !important;
}

/* BibTeX Section Improvements */
.bibtex-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.copy-bibtex-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.copy-bibtex-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.copy-bibtex-btn.copied {
  background: #10b981;
}

.copy-bibtex-btn.copied .copy-text::after {
  content: "ied!";
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
}

.scroll-to-top:hover {
  background: var(--primary-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

/* ========================================
   Teaser Image
   ======================================== */
.teaser-image {
  width: 100%;
  height: auto;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
}

/* ========================================
   Method Section: Pipeline + Cards
   ======================================== */
.pipeline-container {
  position: relative;
  margin-bottom: 2.5rem;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.pipeline-image {
  width: 100%;
  height: auto;
  display: block;
}

.pipeline-highlight {
  position: absolute;
  border: 3px solid transparent;
  border-radius: 8px;
  background: transparent;
  pointer-events: none;
  transition: all 0.4s ease;
  opacity: 0;
}

.pipeline-highlight.active {
  opacity: 1;
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.25);
}

/* Adjust these percentage-based positions when your final pipeline image is ready */
#highlight-step1 {
  top: 1%;
  left: 2%;
  width: 97%;
  height: 60%;
}

#highlight-step2 {
  top: 60%;
  left: 1%;
  width: 41%;
  height: 38%;
}

#highlight-step3 {
  top: 60%;
  left: 43%;
  width: 57%;
  height: 38%;
}

/* Method Cards */
.method-cards {
  margin-top: 1rem;
}

.method-card {
  perspective: 1000px;
  height: 320px;
  cursor: pointer;
}

.method-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.method-card:hover .method-card-inner {
  transform: rotateY(180deg);
}

.method-card-front,
.method-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.method-card-front {
  background: var(--background-primary);
  justify-content: center;
  align-items: center;
  text-align: center;
}

.method-card-back {
  background: var(--background-primary);
  transform: rotateY(180deg);
  justify-content: flex-start;
}

.method-card-back img {
  width: 100%;
  height: 140px;
  object-fit: contain;
  border-radius: var(--border-radius);
  margin-bottom: 0.75rem;
  background: var(--background-accent);
}

.method-card-back p {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

.method-step-number {
  display: inline-block;
  background: var(--gradient-primary);
  color: white;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.method-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.method-card-summary {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ========================================
   Performance: Dataset Tabs
   ======================================== */
.dataset-tabs {
  margin-bottom: 2rem;
}

.dataset-tab {
  background: var(--background-primary);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 0.6rem 1.8rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  margin: 0 0.4rem;
}

.dataset-tab:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.dataset-tab.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-md);
}

.dataset-content {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--background-primary);
}

.dataset-content img {
  width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   Video Segmentation Carousel
   ======================================== */
.video-section-desc {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.video-carousel-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.video-carousel-viewport {
  flex: 1;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #000;
  position: relative;
}

.video-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.video-slide.active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.video-slide video {
  width: 100%;
  height: auto;
  display: block;
}

.video-nav-arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  background: var(--background-primary);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.video-nav-arrow:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

/* Video Indicator Dots */
.video-indicators {
  margin-top: 1.25rem;
}

.video-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-color);
  margin: 0 5px;
  cursor: pointer;
  transition: var(--transition);
}

.video-dot.active {
  background: var(--primary-color);
  transform: scale(1.3);
}

.video-dot:hover {
  background: var(--primary-hover);
}

/* ========================================
   Uncertainty Section
   ======================================== */
.uncertainty-desc {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.uncertainty-image-container {
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--background-primary);
}

.uncertainty-image-container img {
  width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   Mobile Responsive
   ======================================== */
@media screen and (max-width: 768px) {
  .hero-body {
    padding: 2rem 1rem;
  }

  .publication-header .hero-body {
    padding: 3rem 1rem 2rem;
  }

  .publication-title {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1.5rem !important;
  }

  .publication-authors {
    font-size: 1rem !important;
  }

  .button {
    margin: 0.25rem !important;
    font-size: 0.875rem !important;
    padding: 0.75rem 1rem !important;
  }

  .teaser .hero-body {
    padding: 1rem;
  }

  .content.has-text-justified {
    font-size: 1rem;
  }

  /* Method cards stack on mobile */
  .method-card {
    height: 280px;
    margin-bottom: 1rem;
  }

  /* Video arrows smaller on mobile */
  .video-nav-arrow {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }

  .dataset-tab {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
  }
}

@media screen and (max-width: 480px) {
  .publication-title {
    font-size: 2rem !important;
  }

  .hero-body {
    padding: 1.5rem 0.75rem;
  }

  .link-block {
    display: block;
    margin-bottom: 0.5rem;
  }

  .button {
    width: 100%;
    justify-content: center;
  }

  .method-card {
    height: 260px;
  }

  .video-carousel-container {
    gap: 0.5rem;
  }

  .video-nav-arrow {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }
}

/* Tablet Responsive */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .hero-body {
    padding: 3rem 2rem;
  }

  .publication-header .hero-body {
    padding: 4rem 2rem 3rem;
  }
}

/* Animation for page load */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero, .section {
  animation: fadeInUp 0.6s ease-out;
}

/* Improved focus states for accessibility */
.button:focus,
a:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .hero, .section {
    animation: none;
  }

  .button {
    background: transparent !important;
    color: var(--text-primary) !important;
    box-shadow: none !important;
  }

  .scroll-to-top {
    display: none;
  }
}
