/* Video Categories Styling */
.video-categories {
  margin-top: 20px;
}

.video-category-section {
  margin-bottom: 40px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 20px;
  background: #fff;
}

.video-category-title {
  color: #333;
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #007bff;
}

.video-category-title i {
  color: #007bff;
  margin-right: 10px;
}

/* Video Grid */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

/* Video Card */
.video-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
  border: 1px solid #e0e0e0;
  position: relative;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: #f9f9f9;
}

/* Video Thumbnail - Fast Loading */
.video-thumbnail {
  position: relative;
  width: 100%;
  /*height: 200px;*/
  overflow: hidden;
  background: #000;
  border-radius: 8px 8px 0 0;
}

.video-thumbnail img {
  width: 100%;
/*  height: 100%;
  object-fit: cover;*/
  transition: transform 0.3s ease;
  /* Improve loading performance */
  loading: eager;
  decoding: async;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.05);
}

/* Play Overlay */
.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 123, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.video-card:hover .play-overlay {
  background: rgba(0, 123, 255, 1);
  transform: translate(-50%, -50%) scale(1.1);
}

/* Video Duration Badge */
.video-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

/* Video Info */
.video-info {
  padding: 20px;
}

.video-info h4 {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.3;
}

.video-info p {
  color: #666;
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.video-type {
  display: inline-block;
    background: #f4f4f4;
    color: #777;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Video Modal */
.video-container {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
}

.video-container iframe{
    width: 100%;
}

.youtube-embed {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  background: #000;
  border-radius: 8px;
}

.youtube-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}


.modal-lg {
  max-width: 900px;
}

/* Bigger and styled close button */
#videoModal .modal-header .large-close {
  font-size: 28px;  /* Increase size */
  font-weight: bold;
  color: #000;
  opacity: 1;
  background: none;
  border: none;
  line-height: 1;
  margin: 0;
  padding: 0 12px;
  cursor: pointer;
}

#videoModal .modal-header .large-close:hover {
  color: #ff0000; /* optional hover effect */
}


/* Progress tracking */
.video-card.watched::after {
  content: '✓';
  position: absolute;
  top: 10px;
  right: 10px;
  background: #28a745;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  z-index: 10;
}

/* Loading placeholder for images */
.video-thumbnail img {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.video-thumbnail img[src] {
  animation: none;
  background: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .video-category-section {
    padding: 15px;
    margin-bottom: 30px;
  }
  
  .video-category-title {
    font-size: 18px;
  }
  
  .video-thumbnail {
    height: 180px;
  }
  
  .play-overlay {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }
  
  .video-info {
    padding: 15px;
  }
  
  .video-info h4 {
    font-size: 15px;
  }
  
  .modal-dialog {
    margin: 10px;
  }

  .modal-lg {
    max-width: 100%;
    margin: 20px;
  }

}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .video-category-section {
    padding: 10px;
  }
  
  .video-thumbnail {
    height: 160px;
  }
  
  .video-info {
    padding: 12px;
  }
  
  .video-info h4 {
    font-size: 14px;
  }
  
  .video-info p {
    font-size: 13px;
  }
}