/* --- Gallery Layout --- */
.ppt-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 10px;
  justify-content: center;
}

.ppt-image-box {
  width: 200px;
  text-align: center;
}

.ppt-image-box img,
.ppt-image-box video {
  width: 100%;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.ppt-image-box img:hover,
.ppt-image-box video:hover {
  transform: scale(1.05);
}

.ppt-caption {
  margin-top: 6px;
  font-size: 0.9em;
  color: #333;
  line-height: 1.3;
}

.ppt-message-bar {
  margin-bottom: 15px;
  padding: 10px 14px;
  border-left: 4px solid;
  border-radius: 4px;
  font-size: 1em;
}

.ppt-message-bar.nonpremium {
  background: #fff3cd;
  color: #b94a48;
  border-color: #f0ad4e;
}

.ppt-message-bar.premium {
  background: #e1f8ff;
  color: #31708f;
  border-color: #5bc0de;
}

/* Lightbox Controls */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  touch-action: none;
}

.lightbox-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-media {
  max-width: 95vw;
  max-height: 80vh;
  border-radius: 6px;
  object-fit: contain;
  touch-action: pan-x pan-y pinch-zoom;
}

.lightbox-media[controls] {
  max-height: 75vh; /* Adjust for video controls */
}

.video-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  margin-top: 5px;
}

.video-controls button {
  background: #fff;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
}

.video-controls .seek-bar,
.video-controls .volume-bar {
  width: 100px;
  cursor: pointer;
}

.video-controls .time-display {
  color: #fff;
  font-size: 0.9em;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2em;
  color: white;
  cursor: pointer;
  user-select: none;
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  transition: background 0.2s;
}

.lightbox-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
}

.lightbox-arrow.left {
  left: 10px;
}

.lightbox-arrow.right {
  right: 10px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.8em;
  color: white;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  padding: 5px 10px;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* Responsive */
@media (max-width: 768px) {
  .ppt-gallery {
    gap: 10px;
    justify-content: center;
  }

  .ppt-image-box {
    width: 45vw;
    max-width: 180px;
  }

  .ppt-image-box img,
  .ppt-image-box video {
    border-radius: 4px;
  }

  .ppt-caption {
    font-size: 0.85em;
  }

  .ppt-message-bar {
    font-size: 0.95em;
    padding: 8px 12px;
  }

  .lightbox-media {
    max-width: 100vw;
    max-height: 75vh;
  }

  .lightbox-media[controls] {
    max-height: 70vh;
  }

  .video-controls {
    gap: 8px;
    padding: 8px;
  }

  .video-controls .seek-bar,
  .video-controls .volume-bar {
    width: 80px;
  }

  .video-controls button {
    padding: 4px 8px;
    font-size: 0.85em;
  }

  .video-controls .time-display {
    font-size: 0.85em;
  }

  .lightbox-arrow {
    font-size: 1.5em;
    padding: 8px 12px;
  }

  .lightbox-close {
    top: 15px;
    right: 15px;
    font-size: 1.5em;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .ppt-image-box {
    width: 80vw;
    max-width: 300px;
  }

  .lightbox-media {
    max-height: 70vh;
  }

  .lightbox-media[controls] {
    max-height: 65vh;
  }

  .video-controls {
    flex-wrap: wrap;
    gap: 5px;
  }

  .video-controls .seek-bar,
  .video-controls .volume-bar {
    width: 60px;
  }

  .lightbox-arrow {
    font-size: 1.2em;
    padding: 6px 10px;
  }

  .lightbox-close {
    font-size: 1.2em;
    padding: 3px 6px;
  }
}