/* =========================
   Gallery Layout
========================= */
.video-gallery {
  margin-top: 30px;
}

.video-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 30px;
}

.video-item {
  width: 180px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s ease;
}

.video-item:hover {
  transform: scale(1.05);
}

/* =========================
   Back to Home Button Styling
========================= */
.back-home-link {
  display: inline-block;
  margin-bottom: 20px;
  padding: 10px 20px;
  font-size: 1rem;
  font-weight: bold;
  color: #fff;
  background-color: #0056b3; /* Darker blue */
  border: none;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.back-home-link:hover {
  background-color: #007BFF; /* Lighter blue on hover */
}

/* =========================
   Consistent Image Format
========================= */
.image-container {
  width: 90%;
  aspect-ratio: 3 / 4; /* Makes it responsive but keeps poster shape */
  background-color: #000;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Change to 'fill' if needed per image */
}

/* Optional: Add specific rule for very small images */
.image-container img.small-image {
  object-fit: fill;
}

/* =========================
   Video Item Text
========================= */
.video-item p {
  margin-top: 10px;
  font-size: 1rem;
  color: #fff;
}

/* =========================
   Group Headings
========================= */
.movie-group-title {
  font-size: 1.8rem;
  color: #f0f0f0;
  margin-top: 50px;
  margin-bottom: 20px;
  text-align: center;
}

/* =========================
   Modal Popup Player
========================= */
.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.9);
}

.modal-content {
  position: relative;
  margin: 5% auto;
  padding: 0;
  width: 80%;
  max-width: 800px;
}

.modal-content iframe {
  width: 100%;
  height: 450px;
  border: none;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 16px;
  color: #fff;
  font-size: 32px;
  font-weight: bold;
  cursor: pointer;
}

/* =========================
   Desktop Layout - 5 items per row
========================= */
@media screen and (min-width: 769px) {
  .video-item {
    width: calc(20% - 20px); /* 5 items per row, accounting for the gap */
  }
}

.video-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between; /* better spacing */
  gap: 20px;
}


/* =========================
   Mobile Layout - 2 items per row
========================= */
@media screen and (max-width: 768px) {
  .video-item {
    width: calc(50% - 10px);
  }

  .modal-content iframe {
    height: 250px;
  }

  .image-container {
    height: 200px;
  }
  
  .back-home-link {
    display: block;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }
}
