.video-section {
  display: flex;
  justify-content: center;
  align-items: center;
   background: linear-gradient(to top, #b4d9e7ff, #fff);
  height: auto;               /* fixed height */
  width: 100%;
  margin-top: auto;
}
    /* Grid */
 .video-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* exactly 4 items per row */
  gap: 20px;
  height: 100%;
  width: 100%;
  max-width: 1400px; /* optional: keep centered layout */
}
.video-card {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.video-card img {
  width: 100%;
  height: 300px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Always-visible overlay */
.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.45);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.3s ease;
}

/* Play button icon */
.video-overlay i {
  font-size: 60px;
  color: white;
  opacity: 1;
  transition: transform 0.3s ease;
}

/* Hover effect — subtle zoom */
.video-card:hover img {
  transform: scale(1.05);
}

.video-card:hover .video-overlay {
  background: rgba(0,0,0,0.55);
}

.video-card:hover .video-overlay i {
  transform: scale(1.1);
}


    /* Popup */
    .video-popup {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0,0,0,0.8);
      justify-content: center;
      align-items: center;
      z-index: 9999;
    }

    .video-popup video {
      width: 80%;
      max-width: 800px;
      border-radius: 8px;
    }

    .close-btn {
      position: absolute;
      top: 20px;
      right: 30px;
      font-size: 30px;
      color: white;
      cursor: pointer;
    }
    
#popupContent {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  background: #000;   /* fallback background */
  overflow: hidden;
}

#popupContent video,
#popupContent iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
  object-fit: contain;  /* keeps proper aspect ratio */
  display: block;
}


/* Common wrapper for video & iframe */
.video-wrapper {
  position: relative;
  width: 80%;
  max-width: 800px;
  aspect-ratio: 16 / 9; /* keeps both same shape */
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

.video-wrapper video,
.video-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
  object-fit: cover;
}
    @media (max-width: 1200px) {
  .video-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
}
