/* ==================================================
   MFT Comic Viewer - Carroussel version, very alpha!
   ================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: #000;
  color: #fff;
}

/* ========================================
   Header Top Level Navigation (and logo)
   ======================================== */

.mft-cv-header {
  width: 100%;
  background-color: #000;
  padding: 0;
  flex-shrink: 0;
}

.mft-cv-header-content {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.mft-cv-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.3s ease;
  flex-shrink: 0;
}

.mft-cv-logo:hover {
  opacity: 0.8;
}

.mft-cv-logo-svg {
  height: 100%;
  width: auto;
}

.mft-cv-episode-title {
  flex: 1;
  text-align: center;
  color: #fff;
  font-size: 18px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mft-cv-header-nav {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-shrink: 0;
}

.mft-cv-header-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  height: 40px;
  color: #fff;
  text-decoration: none;
  border: 2px solid #c5c5c5;
  border-radius: 16px;
  transition: all 0.3s ease;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.mft-cv-header-pill:hover {
  background-color: #fff;
  border: 2px solid #ffffff;
  color: #000;
}

.mft-cv-header-pill:hover .mft-cv-pill-icon img {
  filter: brightness(0);
}

.mft-cv-pill-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}

.mft-cv-pill-icon img {
  width: 100%;
  height: 100%;
}

.mft-cv-pill-number {
  font-variant-numeric: tabular-nums;
}

/* ========================================
   Main Container
   ======================================== */

.mft-cv-container {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #000;
}

/* ========================================
   Carousel Viewer
   ======================================== */

.mft-cv-viewer {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.mft-cv-carousel {
  position: relative;
  flex: 1;
  overflow: hidden;
  background-color: #000;
}

.mft-cv-viewport {
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.mft-cv-slides {
  display: flex;
  height: 100%;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.mft-cv-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 10px 20px 10px;
  overflow-y: auto;
  background-color: #000;
  position: relative;
  z-index: 1;
}

/* =======================
   Image & Transcript
   ======================= */

/* Note: Many click operation are managed manually with 'pointer-events' 
 * It also fixes a problem with z-index where the description kept under the picture... I hate this  */

.mft-cv-image {
  max-width: 100%;
  max-height: 80vh;
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  margin: 0 auto;
  touch-action: pinch-zoom;
}

.mft-cv-description {
  position: relative;
  width: 100%;
  max-width: 800px;
  padding: 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  flex-shrink: 0;
  z-index: 10;
  pointer-events: none;
}

.mft-cv-description summary {
  pointer-events: auto;
}

.mft-cv-description details[open] > pre {
  pointer-events: auto;
}

.mft-cv-description details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}


.mft-cv-description details > summary {
  width: 10em;
  padding: 6px 12px;
  border: 2px solid #c5c5c5;
  border-radius: 16px;
  cursor: pointer;
  text-align: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.mft-cv-description details[open] > pre {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translate(-50%, -100%);
  width: 90vw;
  max-width: 600px;
  max-height: 55vh;
  padding: 20px;
  background-color: rgba(40, 40, 40, 0.95);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  color: #fff;
  z-index: 100;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  overflow-y: auto;
  animation: fadeIn 0.3s ease-in-out;
}


.mft-cv-description pre .dialogue {
  color: #d4af37;
}

/* ========================================
   Navigation Arrows
   ======================================== */

.mft-cv-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 10;
  padding: 0;
}

.mft-cv-nav-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.mft-cv-nav-btn svg {
  width: 32px;
  height: 32px;
  fill: currentColor;
}

.mft-cv-nav-prev {
  left: 20px;
}

.mft-cv-nav-next {
  right: 20px;
}

/* ========================================
   Navigation Dots
   ======================================== */

.mft-cv-dots {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  background-color: #000;
  flex-wrap: wrap;
  z-index: 999;
}

.mft-cv-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background-color: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.mft-cv-dot:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

.mft-cv-dot[aria-current="page"] {
  background-color: #fff;
  border-color: #fff;
  transform: scale(1.3);
}

.mft-cv-dot:focus {
  background-color: #00aaff;
}


/* ========================================
   Credits Slide
   ======================================== */

.mft-cv-credits-slide {
  padding: 15px;
  justify-content: flex-start;
  overflow-y: auto;
}

.mft-cv-credits-content {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.mft-cv-credits-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 20px;
}

/* [credits] Share Section */

.mft-cv-share-section {
  margin-bottom: 40px;
}

.mft-cv-share-section label {
  display: block;
  font-size: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #FFF;
  margin-top: 40px;
  margin-bottom: 12px;
  text-align: center;
}

.mft-cv-share-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.mft-cv-share-input {
  flex: 1;
  padding: 12px 16px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  font-size: 14px;
  font-family: 'Courier New', monospace;
}

.mft-cv-share-input:focus {
  outline: none;
  border-color: #fff;
  background-color: rgba(255, 255, 255, 0.15);
}

.mft-cv-copy-btn {
  padding: 12px 24px;
  background-color: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.mft-cv-copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.mft-cv-copy-btn:active {
  background-color: rgba(255, 255, 255, 0.4);
}

.mft-cv-feedback {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  min-height: 18px;
}

/* [credits] Listing */

.mft-cv-credits-section {
  margin-bottom: 7px;
  padding-bottom: 7px;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.6);
}

.mft-cv-credits-section strong{
  color: rgba(255, 255, 255, 1);
}

.mft-cv-credits-section a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: underline;
}

.mft-cv-credits-section a:hover {
  color: #fff;
}

/* ========================================
   Video Timelapse Bonus Slide
   ======================================== */

.mft-cv-video-slide {
  padding: 40px 20px;
  justify-content: flex-start;
  overflow-y: auto;
  display: flex;
  align-items: center;
}

.mft-cv-video-content {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.mft-cv-video-content h2 {
  font-size: 32px;
  margin-bottom: 0;
  text-align: center;
  font-weight: 700;
}

.mft-cv-video-content > p {
  text-align: center;
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

.mft-cv-video {
  width: 100%;
  height: auto;
  max-height: 60vh;
  border-radius: 8px;
  background-color: #000000;
}


/* =============================================
   Responsive: Tablet (768) and then phone (480)
   ============================================= */

@media (max-width: 768px) {
  .mft-cv-header-content {
    padding: 0 6px;
    gap: 3px;
  }

  .mft-cv-episode-title {
    display: none;
  }

  .mft-cv-header-pill {
    margin-top: 2px;
    margin-bottom: 2px;
    padding: 6px 10px;
    height: 26px;
    font-size: 12px;
    gap: 3px;
  }
  .mft-cv-pill-icon {
    width: 18px;
    height: 18px;
  }

  .mft-cv-logo-svg {
    max-width: 160px;
  }

  .mft-cv-image {
    max-height: 60vh;
  }

  .mft-cv-nav-btn {
    display: none;
  }

  .mft-cv-nav-btn svg {
    width: 28px;
    height: 28px;
  }

  .mft-cv-nav-prev {
    left: 12px;
  }

  .mft-cv-nav-next {
    right: 12px;
  }

  .mft-cv-description {
    margin-top: 16px;
    padding: 12px;
    font-size: 13px;
  }

  .mft-cv-dots {
    padding: 16px;
    gap: 10px;
  }

  .mft-cv-dot {
    width: 10px;
    height: 10px;
  }

}

@media (max-width: 480px) {

  .mft-cv-image {
    max-height: 50vh;
  }

  .mft-cv-description {
    font-size: 12px;
    padding: 10px;
  }

  .mft-cv-nav-btn {
    width: 44px;
    height: 44px;
  }

  .mft-cv-nav-btn svg {
    width: 24px;
    height: 24px;
  }

  .mft-cv-nav-prev {
    left: 8px;
  }

  .mft-cv-nav-next {
    right: 8px;
  }

  .mft-cv-dot {
    width: 8px;
    height: 8px;
    border-width: 1px;
  }

  .mft-cv-share-section {
    margin-bottom: 10px;
  }
  .mft-cv-share-section label {
    margin-top: 10px;
    font-size: 14px;
  }

  .mft-cv-share-input-group {
    flex-direction: column;
  }

  .mft-cv-share-input {
    padding: 6px 11px;
  }

  .mft-cv-copy-btn {
    width: 100%;
    padding: 7px 7px;
  }

  .mft-cv-credits-section {
    margin-bottom: 4px;
    padding-bottom: 4px;
    font-size: 12px;
  }

  .mft-cv-video-content h2 {
    font-size: 14px;
  }

  .mft-cv-video-content p {
    font-size: 12px;
  }
}

/* Implement a way to disable the transition, for browser and accessibility issue with this type of motion sickness maybe */

@media (prefers-reduced-motion: reduce) {
  .mft-cv-slides {
    transition: none;
  }

  .mft-cv-nav-btn,
  .mft-cv-dot {
    transition: none;
  }
}
