.media-loader {
  position: relative;
}

.media-skeleton {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: opacity 0.5s ease-in-out;
}

.skeleton-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.skeleton-play-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.skeleton-play-icon::after {
  content: "▶️";
  font-size: 24px;
  opacity: 0.6;
}

.skeleton-text {
  width: 120px;
  height: 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.media-loader.loaded .media-skeleton {
  opacity: 0;
  pointer-events: none;
}

.media-loader.loaded video {
  opacity: 1 !important;
}

/* Video Modal Styles */
.media-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  margin: 5% auto;
  padding: 0;
  width: 90%;
  max-width: 1200px;
  height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close {
  position: absolute;
  top: -50px;
  right: 0;
  color: white;
  font-size: 35px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  transition: color 0.3s ease;
}

.modal-close:hover {
  color: #ccc;
}

.modal-video-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modalVideo {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Gallery Grid Styles */
.gallery-wrapper {
  display: grid;
  gap: 20px;
  margin-top: 30px;
  grid-template-columns: repeat(5, 1fr);
}

.video-item {
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.video-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.video-item video {
  width: 100%;
  height: auto;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  cursor: pointer;
  display: block;
}

/* Mobile responsive */
@media (max-width: 1200px) {
  .gallery-wrapper {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 968px) {
  .gallery-wrapper {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
}

@media (max-width: 768px) {
  .gallery-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .modal-content {
    width: 95%;
    height: 70vh;
    margin: 15% auto;
  }

  .modal-close {
    top: -40px;
    font-size: 28px;
  }
}

@media (max-width: 480px) {
  .gallery-wrapper {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}
