/* ==========================================================================
   REASAN - Modern Research Paper Website
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Variables
   -------------------------------------------------------------------------- */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-text: #1f2937;
  --color-text-light: #6b7280;
  --color-text-muted: #9ca3af;
  --color-bg: #ffffff;
  --color-bg-alt: #f9fafb;
  --color-border: #e5e7eb;
  --color-link: #2563eb;
  --color-link-hover: #1d4ed8;

  --font-serif: 'Libre Baskerville', 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'Source Code Pro', 'SF Mono', 'Consolas', monospace;

  --sidebar-width-collapsed: 60px;
  --sidebar-width-expanded: 250px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

/* --------------------------------------------------------------------------
   Base Styles
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  font-weight: 400;
  letter-spacing: 0.01em;
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-link-hover);
}

img {
  max-width: 100%;
  height: auto;
}

/* --------------------------------------------------------------------------
   Sidebar Styles (PRESERVED - DO NOT MODIFY)
   -------------------------------------------------------------------------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 60px;
  background: #ffffff;
  border-right: 1px solid #e5e5e5;
  box-shadow: 1px 0 1px rgba(10, 10, 10, 0.1);
  transition: all 0.3s ease;
  z-index: 1000;
  overflow: hidden;
}

.sidebar.expanded {
  width: 250px;
}

.sidebar:not(.expanded):hover {
  width: 250px;
}

.sidebar:not(.expanded):hover .sidebar-link span {
  opacity: 1;
  transform: translateX(0);
}

.sidebar:not(.expanded):hover .sidebar-logo span {
  opacity: 1;
  transform: translateX(0);
}

.sidebar:hover {
  width: 250px;
}

.sidebar:hover .sidebar-link span {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-toggle {
  display: none !important;
}

.sidebar-content {
  padding-top: 20px;
  padding-bottom: 20px;
  height: 100%;
  overflow: hidden;
  width: 100%;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
}

.sidebar-nav li {
  margin: 0;
  width: 100%;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: #5a5a5a;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
  font-weight: 500;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-link i {
  font-size: 16px;
  min-width: 20px;
  text-align: center;
  color: #6c757d;
}

.sidebar-link span {
  margin-left: 15px;
  opacity: 0;
  transform: translateX(-20px);
  transition: all 0.3s ease;
}

.sidebar.expanded .sidebar-link span {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-link:hover {
  background: #f8f9fa;
  color: #333;
  transform: translateX(3px);
}

.sidebar-link:hover i {
  color: #007bff;
}

.sidebar-link.active {
  background: #e3f2fd;
  color: #1976d2;
  border-right: 3px solid #1976d2;
}

.sidebar-link.active i {
  color: #1976d2;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: #007bff;
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.sidebar-link:hover::before {
  transform: scaleY(1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  padding: 20px 10px;
  color: #5a5a5a;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
  font-weight: 600;
  border-bottom: 1px solid #f0f0f0;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

.sidebar-logo img {
  width: 42px;
  height: 42px;
  min-width: 42px;
  transition: all 0.3s ease;
  margin-bottom: 4px;
}

.sidebar-logo span {
  margin-left: 0;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.sidebar.expanded .sidebar-logo {
  padding: 25px 20px;
}

.sidebar.expanded .sidebar-logo img {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
}

.sidebar.expanded .sidebar-logo span {
  opacity: 1;
  transform: scale(1);
  font-size: 24px;
}

.sidebar:not(.expanded):hover .sidebar-logo {
  padding: 25px 20px;
}

.sidebar:not(.expanded):hover .sidebar-logo img {
  width: 64px;
  height: 64px;
  margin-bottom: 8px;
}

.sidebar:not(.expanded):hover .sidebar-logo span {
  opacity: 1;
  transform: scale(1);
  font-size: 24px;
}

/* --------------------------------------------------------------------------
   Main Content Layout
   -------------------------------------------------------------------------- */
.main-content {
  margin-left: var(--sidebar-width-collapsed);
  min-height: 100vh;
  transition: margin-left var(--transition-normal);
}

/* --------------------------------------------------------------------------
   Container
   -------------------------------------------------------------------------- */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container-wide {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero-section {
  padding: 4rem 0 3rem;
  text-align: center;
  background: linear-gradient(180deg, var(--color-bg-alt) 0%, var(--color-bg) 100%);
}

.teaser-video {
  margin-top: 2.5rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.teaser-video video {
  width: 100%;
  display: block;
}

.paper-title {
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin: 0 0 1.75rem;
  line-height: 1.3;
}

.paper-subtitle {
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Authors
   -------------------------------------------------------------------------- */
.authors {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.25rem;
  margin-bottom: 0.5rem;
}

.author {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--color-link);
  transition: color var(--transition-fast);
}

.author:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.author sup {
  font-size: 0.7em;
  margin-left: 1px;
}

/* --------------------------------------------------------------------------
   Affiliations
   -------------------------------------------------------------------------- */
.affiliations {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  margin-bottom: 1.75rem;
}

.affiliation {
  font-size: 1.1rem;
  color: var(--color-text-light);
}

.affiliation sup {
  font-size: 0.7em;
  margin-right: 2px;
}

/* --------------------------------------------------------------------------
   Action Buttons
   -------------------------------------------------------------------------- */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn i {
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--color-text);
  color: #fff;
}

.btn-primary:hover {
  background: #374151;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg-alt);
  color: var(--color-text);
  border-color: var(--color-text-muted);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* --------------------------------------------------------------------------
   Content Sections
   -------------------------------------------------------------------------- */
.content-section {
  padding: 3rem 0;
}

.content-section.alt-bg {
  background: var(--color-bg-alt);
}

.section-title {
  font-size: 2.25rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 0 0 1.25rem;
  letter-spacing: -0.01em;
}

.section-description {
  font-size: 1.2rem;
  color: var(--color-text-light);
  text-align: center;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Pipeline Image
   -------------------------------------------------------------------------- */
.pipeline-image {
  text-align: center;
}

.pipeline-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.subsection-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 2.5rem 0 1rem;
  text-align: center;
}

.training-video {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.training-video video {
  width: 100%;
  display: block;
}

/* --------------------------------------------------------------------------
   Video Grid
   -------------------------------------------------------------------------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.video-card {
  background: var(--color-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

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

.video-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.video-wrapper video {
  width: 100%;
  display: block;
}

.video-wrapper-yt {
  padding-bottom: 56.25%;
  /* 16:9 aspect ratio */
}

.video-wrapper-yt iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.video-label {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  margin: 0;
  padding: 0.75rem 1rem;
  text-align: center;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
}

@media only screen and (max-width: 600px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   YouTube Videos
   -------------------------------------------------------------------------- */
.youtube-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.youtube-card {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.youtube-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  /* 16:9 aspect ratio */
}

.youtube-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media only screen and (max-width: 600px) {
  .youtube-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Abstract
   -------------------------------------------------------------------------- */
.abstract-text {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--color-text);
}

.abstract-text p {
  margin: 0 0 1rem;
}

.abstract-text p:last-child {
  margin-bottom: 0;
}

.inline-link {
  color: var(--color-link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-link:hover {
  color: var(--color-link-hover);
}

/* --------------------------------------------------------------------------
   Citation Block
   -------------------------------------------------------------------------- */
.citation-block {
  position: relative;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}

.citation-block pre {
  margin: 0;
  padding: 1.5rem;
  overflow-x: auto;
}

.citation-block code {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-text);
}

.copy-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-sans);
  color: var(--color-text-light);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.copy-btn:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 2rem 0;
  text-align: center;
  border-top: 1px solid var(--color-border);
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Mobile Responsiveness - Sidebar (PRESERVED)
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 1023px) {
  .sidebar {
    width: 50px;
    display: block;
  }

  .sidebar.expanded {
    width: 200px;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }

  .sidebar:not(.expanded):hover {
    width: 200px;
  }

  .sidebar-link {
    padding: 8px 5px;
    justify-content: center;
    min-height: 40px;
  }

  .sidebar-link i {
    font-size: 14px;
    min-width: 14px;
    margin: 0;
  }

  .sidebar-link span {
    display: none;
  }

  .sidebar.expanded .sidebar-link,
  .sidebar:not(.expanded):hover .sidebar-link {
    padding: 12px 15px;
    justify-content: flex-start;
  }

  .sidebar.expanded .sidebar-link i,
  .sidebar:not(.expanded):hover .sidebar-link i {
    font-size: 16px;
    min-width: 20px;
  }

  .sidebar.expanded .sidebar-link span,
  .sidebar:not(.expanded):hover .sidebar-link span {
    display: inline;
  }

  .sidebar-logo {
    padding: 8px 5px !important;
    min-height: 65px;
  }

  .sidebar-logo img {
    width: 34px !important;
    height: 34px !important;
    margin-bottom: 3px !important;
    object-fit: contain !important;
    max-width: 34px !important;
    max-height: 34px !important;
  }

  .sidebar.expanded .sidebar-logo img,
  .sidebar:not(.expanded):hover .sidebar-logo img {
    width: 58px !important;
    height: 58px !important;
    margin-bottom: 8px !important;
    object-fit: contain !important;
    max-width: 58px !important;
    max-height: 58px !important;
  }

  .sidebar-toggle {
    display: none !important;
  }

  .sidebar-content {
    padding-bottom: 20px !important;
    height: 100% !important;
  }

  .sidebar {
    z-index: 1010;
  }

  .main-content {
    margin-left: 50px !important;
    transition: none !important;
  }
}

@media only screen and (max-width: 768px) {
  .sidebar {
    width: 45px;
  }

  .sidebar-link {
    padding: 6px 2px;
    min-height: 36px;
  }

  .sidebar-link i {
    font-size: 12px;
    min-width: 12px;
  }

  .sidebar-logo {
    padding: 8px 3px !important;
    min-height: 60px;
  }

  .sidebar-logo img {
    width: 28px !important;
    height: 28px !important;
    margin-bottom: 3px !important;
    object-fit: contain !important;
    max-width: 28px !important;
    max-height: 28px !important;
  }

  .sidebar.expanded .sidebar-logo,
  .sidebar:not(.expanded):hover .sidebar-logo {
    padding: 20px 12px !important;
  }

  .sidebar.expanded .sidebar-logo img,
  .sidebar:not(.expanded):hover .sidebar-logo img {
    width: 48px !important;
    height: 48px !important;
    object-fit: contain !important;
    max-width: 48px !important;
    max-height: 48px !important;
  }

  .sidebar.expanded .sidebar-logo span,
  .sidebar:not(.expanded):hover .sidebar-logo span {
    font-size: 16px !important;
    display: inline !important;
  }
}

/* --------------------------------------------------------------------------
   Mobile Responsiveness - Content
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 768px) {
  .main-content {
    margin-left: 45px !important;
  }

  .container {
    padding: 0 1.25rem;
  }

  .hero-section {
    padding: 4rem 0 3rem;
  }

  .paper-title {
    font-size: 2.5rem;
  }

  .paper-subtitle {
    font-size: 1.15rem;
  }

  .authors {
    gap: 0.25rem 1rem;
  }

  .author {
    font-size: 1rem;
  }

  .affiliations {
    gap: 0.25rem 1.5rem;
  }

  .affiliation {
    font-size: 0.9rem;
  }

  .action-buttons {
    gap: 0.75rem;
  }

  .btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
  }

  .content-section {
    padding: 3.5rem 0;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .abstract-text {
    font-size: 1rem;
  }

  .citation-block pre {
    padding: 1rem;
  }

  .citation-block code {
    font-size: 0.75rem;
  }

  .copy-btn {
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }
}

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

  .paper-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  .action-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 200px;
    justify-content: center;
  }
}