/* Gallery Modal Styles - Extracted from inline CSS */

/* Image Modal Styles */
.image-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.image-modal.active {
  display: flex;
}

.image-modal-content {
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  width: 90%;
  max-height: 90vh;
  background-color: #141414;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.modal-image-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: grab;
}

.modal-image-container.zoomed {
  cursor: grab;
}

.modal-image-container.panning {
  cursor: grabbing;
}

.modal-image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  transition: transform 0.1s ease-out;
  transform-origin: center center;
}

.modal-image.zoomable {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
}

.modal-image-info {
  padding: 20px;
  background-color: #141414;
  color: white;
}

.modal-image-title {
  font-size: 1.8rem;
  margin: 0 0 10px 0;
  color: white;
}

.modal-image-desc {
  font-size: 1rem;
  margin: 0 0 15px 0;
  color: #b3b3b3;
  line-height: 1.5;
}

.modal-image-categories {
  display: none; /* Hide tags in modal */
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.category-tag {
  display: inline-block;
  padding: 5px 10px;
  background-color: rgba(0, 188, 212, 0.2);
  color: #00bcd4;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* Video Modal Styles - Match Image Modal Format */
.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.video-modal.active {
  display: flex;
}

.video-modal-content {
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  width: 90%;
  max-height: 90vh;
  background-color: #141414;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.modal-video-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px; /* Ensure minimum height */
  cursor: grab;
}

.modal-video-container.zoomed {
  cursor: grab;
}

.modal-video-container.panning {
  cursor: grabbing;
}

/* Video aspect ratio wrapper */
.video-aspect-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  max-height: 70vh;
  aspect-ratio: 16 / 9; /* Standard video aspect ratio */
  background-color: #000;
  transition: transform 0.1s ease-out;
  transform-origin: center center;
}

.video-aspect-wrapper.zoomable {
  max-width: none;
  max-height: none;
  width: auto;
  height: auto;
}

.modal-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain; /* Maintain aspect ratio within container */
  background-color: #000;
}

/* Responsive adjustments for video aspect wrapper */
@media (max-height: 600px) {
  .video-aspect-wrapper {
    max-height: 50vh;
  }
}

.modal-video-info {
  padding: 20px;
  background-color: #141414;
  color: white;
}

.modal-video-title {
  font-size: 1.8rem;
  margin: 0 0 10px 0;
  color: white;
}

.modal-video-desc {
  font-size: 1rem;
  margin: 0 0 15px 0;
  color: #b3b3b3;
  line-height: 1.5;
}

.modal-video-categories {
  display: none; /* Hide tags in modal */
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

/* Page-level Back Button - Fixed position on page */
.page-back-button {
  position: fixed;
  top: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  color: #333;
  cursor: pointer;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 1002; /* Above modal */
  transition: all 0.3s ease;
  opacity: 0.9;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.page-back-button:hover {
  background-color: white;
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.page-back-button.visible {
  display: flex;
}

.page-back-button i {
  pointer-events: none;
}

/* Modal Navigation Arrow Styles */
.modal-nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  color: #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  z-index: 1001;
  transition: all 0.3s ease;
  opacity: 0.9;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.modal-nav-arrow:hover {
  background-color: white;
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.modal-nav-arrow.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0.5);
}

.modal-nav-left {
  left: calc(50% - 750px);
}

.modal-nav-right {
  right: calc(50% - 750px);
}

/* Responsive positioning for smaller screens */
@media (max-width: 1400px) {
  .modal-nav-left {
    left: 20px;
  }
  .modal-nav-right {
    right: 20px;
  }
}

.modal-nav-arrow i {
  pointer-events: none;
}

/* Responsive adjustments for image modal */
@media (max-width: 768px) {
  .image-modal-content {
    width: 95%;
  }

  .modal-image-title {
    font-size: 1.5rem;
  }

  .modal-image-desc {
    font-size: 0.9rem;
  }

  /* Video modal responsive adjustments */
  .video-modal-content {
    width: 95%;
  }

  .modal-video-title {
    font-size: 1.5rem;
  }

  .modal-video-desc {
    font-size: 0.9rem;
  }
}

/* Modal Counter Styles */
.modal-counter {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  user-select: none;
}

/* Responsive counter adjustments */
@media (max-width: 768px) {
  .modal-counter {
    bottom: 15px;
    right: 15px;
    font-size: 0.8rem;
    padding: 6px 12px;
  }
}
