/* Custom Responsive CSS for Reveal.js Presentations */

/* Responsive containers */
.responsive-container {
  display: flex;
  flex-direction: column;
  height: 80vh;
  width: 100%;
  overflow: visible;
}

.responsive-list {
  flex: 1;
  min-height: 0;
  margin: 0 !important;
  padding: 0 !important;
}

.code-container {
  max-height: 50vh;
  overflow: auto;
  margin: 20px 0;
  width: 95%;
  border-radius: 6px;
}

.image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  max-height: 50vh;
}

.responsive-image {
  max-width: 100%;
  max-height: 45vh;
  object-fit: contain;
}

.title-slide {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 85vh;
  text-align: center;
}

/* Base font scaling */
.reveal {
  font-size: calc(1em + 1vmin);
}

/* Responsive headings */
.reveal h1 {
  font-size: calc(2.5em + 1.5vmin);
  margin-bottom: 0.5em;
}

.reveal h2 {
  font-size: calc(1.8em + 1vmin);
}

/* Slide content padding adjustments */
.reveal .slides section {
  padding: 2vh 2vw;
  height: 92vh;
  overflow: hidden;
}

/* Lists spacing and sizing */
.reveal ul, 
.reveal ol {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0;
}

.reveal li {
  font-size: calc(0.9em + 0.7vmin);
  margin-bottom: 2vh;
  line-height: 1.4;
}

/* Responsive images */
.reveal img {
  max-width: 90%;
  max-height: 60vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Code block enhancement */
.reveal pre {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  margin: 0.5em 0;
  padding: 1em;
  overflow: visible !important;
  width: 100%;
  font-family: 'Fira Code', 'Roboto Mono', 'Source Code Pro', monospace;
  font-size: calc(0.7em + 0.4vmin);
  line-height: 1.5;
  max-height: none !important;
}

.reveal pre code {
  overflow: visible !important;
  max-height: none !important;
  white-space: pre-wrap !important;
  word-wrap: break-word;
}

.reveal code {
  padding: 0.2em;
  max-width: 100%;
  border-radius: 4px;
}

/* Ensure the code stays intact without unexpected paragraphs */
.reveal .highlight {
  white-space: pre;
}

/* Fix for unwanted paragraph tags */
.reveal .highlight p {
  display: inline;
  margin: 0;
  padding: 0;
}

/* Media queries for different screen sizes */
@media (max-width: 1024px) {
  .reveal li {
    margin-bottom: 1.5vh;
  }
  
  .reveal pre {
    max-height: 40vh;
  }
  
  .reveal img {
    max-height: 50vh;
  }
  
  .responsive-container {
    height: 75vh;
  }
  
  .code-container {
    max-height: 40vh;
  }
  
  .responsive-image {
    max-height: 35vh;
  }
}

/* Even smaller screens */
@media (max-width: 768px) {
  .reveal .slides section {
    padding: 1vh 1vw;
  }
  
  .reveal li {
    margin-bottom: 1vh;
  }
  
  .responsive-container {
    height: 70vh;
  }
  
  .responsive-image {
    max-height: 30vh;
  }
  
  .code-container {
    max-height: 35vh;
    font-size: 0.8em;
  }
}

/* For portrait orientation */
@media (orientation: portrait) {
  .reveal img {
    max-width: 95%;
    max-height: 40vh;
  }
  
  .reveal pre {
    max-height: 30vh;
  }
  
  .responsive-container {
    height: 65vh;
  }
  
  .responsive-image {
    max-height: 25vh;
  }
  
  .title-slide h1 {
    font-size: calc(2em + 1vmin);
  }
  
  .title-slide h2 {
    font-size: calc(1.5em + 0.8vmin);
  }
}

/* High-resolution screens */
@media (min-width: 1920px) {
  .reveal {
    font-size: calc(1.2em + 0.8vmin);
  }
}

/* Add fade-in animation for fragments */
.reveal .fragment {
  opacity: 0;
  transition: all 0.5s ease;
}

.reveal .fragment.visible {
  opacity: 1;
}