/* css/lecture-content.css */

/* Lecture sections */
.lecture-section {
  margin: 0 auto 30px auto; /* Center horizontally with auto margins */
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  width: 100%; /* Full width within its container */
  max-width: 100%; /* Ensure it doesn't exceed container width */
}

.lecture-section:last-child {
  border-bottom: none;
}

.lecture-section h2 {
  color: #ffffff;
  margin-bottom: 15px;
  font-size: 1.5em;
}

.lecture-section p {
  margin-bottom: 15px;
  line-height: 1.6;
  color: #ffffff;
}

.lecture-section ul, .lecture-section ol {
  margin-left: 24px;
  padding-left: 0;
  margin-bottom: 15px;
  color: #ffffff;
}

.lecture-section li {
  margin-bottom: 8px;
  line-height: 1.5;
  color: #ffffff;
}

/* Tables */
.lecture-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  color: #ffffff;
}

.lecture-table th, .lecture-table td {
  padding: 10px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.lecture-table th {
  background-color: rgba(255, 255, 255, 0.2);
  font-weight: bold;
}

/* Images */
.lecture-image {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 5px;
}

.lecture-image-caption {
  text-align: center;
  font-style: italic;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.7);
}

/* KaTeX specific styling */
.katex {
  font-size: 1.1em !important;
  color: #ffffff;
}

.katex-display {
  text-align: center !important;
  width: 100%;
  display: block;
  margin: 0.6em 0;
}

/* Override KaTeX colors for better visibility on dark background */
.katex .mord, .katex .mbin, .katex .mrel, .katex .mopen, .katex .mclose, .katex .mpunct, .katex .minner {
  color: #ffffff !important;
}

/* Responsive design for lecture content */
@media screen and (max-width: 768px) {
  .lecture-section h2 {
    font-size: 1.3em;
  }
  
  .lecture-table {
    font-size: 0.9em;
  }
  
  .katex {
    font-size: 1em !important;
  }
}

/* Main lecture content container - scrollytelling layout */
.lecture-content {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 12px 40px;
  box-sizing: border-box;
}

.lecture-scrolly {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  --accent: #ff8800;
}

.lecture-rail {
  min-width: 0;
  transform: translateX(-100px);
}

.lecture-media-panel {
  position: sticky;
  top: 0;
  align-self: stretch;
  min-width: 0;
  height: 100vh;
  display: grid;
  place-items: center;
  transform: translateX(100px);
}

.media-card {
  background: #0c0c0c;
  border-radius: 24px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.45);
  width: min(520px, 100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lecture-media-panel.is-image-only .media-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.media-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 20px;
  overflow: hidden;
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.9));
}

.lecture-media-panel.is-image-only .media-visual {
  background: transparent;
  border-radius: 0;
  aspect-ratio: auto;
  height: auto;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-placeholder {
  position: absolute;
  inset: 0;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.lecture-media-panel.is-image-only .media-placeholder,
.lecture-media-panel.is-image-only .media-grid,
.lecture-media-panel.is-image-only .media-orb,
.lecture-media-panel.is-image-only .media-scan {
  display: none;
}

.media-placeholder.is-hidden {
  opacity: 0;
}

.media-orb {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  top: 15%;
  left: 10%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.05));
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
  filter: saturate(1.2);
}

.media-grid {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.25;
}

.media-scan {
  position: absolute;
  left: -10%;
  right: -10%;
  height: 2px;
  top: 15%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 12px var(--accent);
  animation: mediaScan 4.6s ease-in-out infinite;
}

.media-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.lecture-media-panel.is-image-only .media-image {
  position: relative;
  inset: auto;
  width: min(560px, 100%);
  height: auto;
  object-fit: contain;
}

.media-image.is-visible {
  opacity: 1;
}

.media-meta {
  margin-top: 18px;
  color: #d7dbe6;
}

.media-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 700;
}

.media-title {
  font-size: 20px;
  margin-bottom: 10px;
  font-weight: 700;
  color: #ffffff;
}

.media-description {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
}

.lecture-media-panel.is-image-only .media-meta {
  display: none;
}

.media-custom {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2;
}

.lecture-media-panel.is-custom .media-custom {
  display: flex;
}

.lecture-media-panel.is-custom .media-placeholder,
.lecture-media-panel.is-custom .media-image {
  display: none;
}

.lecture-media-panel.is-custom .media-visual {
  background: transparent;
  border-radius: 0;
  aspect-ratio: auto;
  height: auto;
  overflow: visible;
}

.lecture-media-panel.is-custom .media-custom {
  position: relative;
  inset: auto;
  padding: 0;
}

.lecture-media-panel.is-custom .media-meta {
  display: none;
}

/* Interactive Lecture Segments */
.lecture-segments-container {
  position: relative;
  width: 100%;
  min-height: 0;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  scroll-snap-type: y mandatory;
}

.lecture-slide {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
}

.lecture-segment {
  background: #0c0c0c;
  color: #ffffff;
  padding: 32px 34px;
  border-radius: 24px;
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 80px);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  box-sizing: border-box;
}

.lecture-segment .segment-content {
  padding-left: 0;
  padding-right: 0;
  max-width: 100%;
  margin: 0;
  width: 100%;
  overflow-y: visible;
  max-height: none;
}

.lecture-segment .segment-content h2 {
  margin: 0 0 16px 0;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: rgba(19, 19, 19, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  box-shadow: none;
}

.lecture-segment .segment-content .segment-media {
  display: none;
}

.lecture-media-panel.is-empty .media-card {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  visibility: hidden;
}

/* Ensure default text and lists inside segments are aligned consistently */
.lecture-segment .segment-content p {
  margin: 0 0 15px 0;
  line-height: 1.6;
  color: #ffffff;
}

.lecture-segment .segment-content ul,
.lecture-segment .segment-content ol {
  margin-left: 24px;
  padding-left: 0;
  margin-bottom: 15px;
  color: #ffffff;
}

.lecture-segment .segment-content li {
  margin-bottom: 8px;
  line-height: 1.5;
  color: #ffffff;
}

.lecture-segment.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Segment Titles */
.segment-title {
  font-size: 1.8rem;
  margin-bottom: 20px;
  color: #ffffff;
  position: relative;
  padding-bottom: 10px;
  font-weight: 600;
  text-align: center;
}

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

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lecture-segment .segment-content > * {
  opacity: 1;
}

.lecture-segment.is-visible .segment-content > * {
  animation: fadeInUp 0.5s ease forwards;
}

.lecture-segment .segment-content > *:nth-child(1) { animation-delay: 0.1s; }
.lecture-segment .segment-content > *:nth-child(2) { animation-delay: 0.2s; }
.lecture-segment .segment-content > *:nth-child(3) { animation-delay: 0.3s; }
.lecture-segment .segment-content > *:nth-child(4) { animation-delay: 0.4s; }
.lecture-segment .segment-content > *:nth-child(5) { animation-delay: 0.5s; }
.lecture-segment .segment-content > *:nth-child(6) { animation-delay: 0.6s; }

.segment-footer {
  margin-top: 18px;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.segment-prev {
  background: transparent;
  color: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.segment-prev:hover {
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.segment-prev:active {
}

.segment-prev.is-disabled {
  opacity: 0.35;
  pointer-events: none;
}

.segment-prev:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.segment-next {
  background: linear-gradient(135deg, var(--accent), #ff6b2c);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: transform 0.12s ease, background 0.2s ease, filter 0.2s ease;
}

.segment-next:hover {
  filter: brightness(1.06);
}

.segment-next:active {
  transform: translateY(1px) scale(0.98);
  filter: brightness(0.95);
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
  .lecture-slide {
    min-height: auto;
    height: auto;
    padding: 20px 0;
  }

  .lecture-segment {
    padding: 24px;
    min-height: auto;
    max-height: none;
  }

  .lecture-segment .segment-content {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  
  .segment-title {
    font-size: 1.5rem;
  }
  
  .segment-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .segment-prev,
  .segment-next {
    width: 100%;
    text-align: center;
  }
}

@media screen and (max-width: 1000px) {
  .lecture-scrolly {
    grid-template-columns: 1fr;
  }

  .lecture-media-panel {
    position: relative;
    top: 0;
    margin-top: 24px;
    padding-left: 0;
    height: auto;
    display: block;
    transform: none;
  }

  .lecture-rail {
    padding-right: 0;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lecture-segment,
  .lecture-segment.is-visible,
  .media-scan {
    transition: none;
    animation: none;
  }
}

@keyframes mediaScan {
  0% {
    transform: translateY(0);
    opacity: 0.3;
  }
  50% {
    transform: translateY(160px);
    opacity: 0.9;
  }
  100% {
    transform: translateY(320px);
    opacity: 0.3;
  }
}

/* Side Navigation System - Positioned relative to lecture-content */
.side-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  transition: all 0.3s ease;
  z-index: 100;
  opacity: 1;
  visibility: visible;
  background-color: transparent;
  pointer-events: auto;
}

.side-nav-prev {
  left: 16px;
  border-top-right-radius: 8px;
  border-bottom-right-radius: 8px;
}

.side-nav-next {
  right: 16px;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
}

.side-nav-icon {
  position: relative;
  color: #ffffff;
  font-size: 18px;
  z-index: 101;
  background: #121212;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.1s ease;
  cursor: pointer;
  pointer-events: auto;
}

.side-nav.is-disabled {
  pointer-events: none !important;
}

.side-nav.is-disabled .side-nav-icon {
  opacity: 0.2 !important;
  box-shadow: none !important;
  background: #2c2c2c !important;
  color: #777 !important;
  cursor: not-allowed !important;
  transform: none !important;
  pointer-events: none !important;
}

.side-nav:not(.is-disabled):hover .side-nav-icon {
  background: #1a1a1a;
}

.side-nav:not(.is-disabled) .side-nav-icon:active {
  transform: scale(1.08);
  background: #222;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* Quiz Button Container */
.quiz-button-container {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 40px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  transform: translateY(20px);
  height: 220px;
}

.quiz-button-container.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#lecture-quiz-cta {
  scroll-margin: 0;
}

.lecture-cta-slide .quiz-button-container {
  margin-top: 0;
}

/* Atom image styling */
.atom-image {
  position: absolute;
  top: -0px; /* Adjusted position to be closer to the button */
  width: 180px;
  height: auto;
  z-index: 3; /* Behind the button */
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
  transition: transform 0.3s ease;
  pointer-events: none; /* Fixed typo: was "noe" */
}

/* Game-like quiz button - with reflection effect */
.animated-quiz-button {
  background: linear-gradient(135deg, #ff8800, #ff6600);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 15px 40px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 0 #cc5500, 0 8px 20px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 60px; /* Space for the atom image */
  z-index: 4;
}

/* Reflection effect - only for quiz button */
.animated-quiz-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.7s ease;
}

.animated-quiz-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 9px 0 #cc5500, 0 12px 25px rgba(0, 0, 0, 0.4);
}

.animated-quiz-button:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #cc5500, 0 4px 10px rgba(0, 0, 0, 0.3);
}

.animated-quiz-button:hover::before {
  left: 100%;
}

/* Button hover effect on the atom image */
.quiz-button-container:hover .atom-image {
  transform: translateY(-5px) rotate(5deg);
}

/* Floating animation for the atom */
@keyframes float {
  0% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(3deg);
  }
  100% {
    transform: translateY(0) rotate(0deg);
  }
}

.atom-image {
  animation: float 3s ease-in-out infinite;
}

#buttons-container {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Media query for smaller screens to adjust navigation position */
@media screen and (max-width: 1000px) {
  .side-nav-prev {
    left: 10px;
  }
  
  .side-nav-next {
    right: 10px;
  }
} 
