/* YouTube Gallery Block Styles */
.youtube-gallery-block {
  margin: 20px 0;
  padding: 0;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 25px;
  margin: 0;
  padding: 0;
}

.video-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.3s ease;
}

.video-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.video-thumbnail {
  position: relative;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail img {
  transform: scale(1.05);
}

.play-button-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card:hover .play-button-overlay {
  opacity: 1;
}

.play-button-overlay svg {
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.3));
  transition: transform 0.2s ease;
}

.video-card:hover .play-button-overlay svg {
  transform: scale(1.1);
}

.video-info {
  padding: 15px;
}

.video-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px 0;
  line-height: 1.4;
  color: #333;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-stats {
  font-size: 13px;
  color: #666;
  margin: 0;
}

/* Modal Popup Styles */
.video-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(5px);
}

.modal-container {
  position: relative;
  width: 90%;
  max-width: 1000px;
  margin: 50px auto;
  background: transparent;
  border-radius: 12px;
  overflow: hidden;
  animation: slideIn 0.3s ease;
}

.modal-header {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
}

.modal-close {
  font-size: 40px;
  font-weight: bold;
  color: white;
  cursor: pointer;
  background: rgba(0,0,0,0.5);
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255,0,0,0.8);
  transform: rotate(90deg);
}

.modal-body {
  width: 100%;
  background: #000;
}

.video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
}

.video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
  }
  
  .modal-container {
    width: 95%;
    margin: 30px auto;
  }
  
  .modal-close {
    font-size: 35px;
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-container {
    width: 98%;
    margin: 20px auto;
  }
  
  .video-title {
    font-size: 14px;
  }
}