/**
 * Riverstone International School - Video Gallery & Popup Lightbox
 * Modern responsive cards with interactive video player modal
 */

/* ==========================================================================
   Video Card Grid
   ========================================================================== */
.ris-video-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--ris-radius-md, 12px);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--ris-border, #e2e8f0);
  box-shadow: 0 3px 10px rgba(1, 51, 122, 0.06);
  transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
  cursor: pointer;
}

.ris-video-card:hover {
  transform: translateY(-6px);
  border-color: rgba(10, 189, 255, 0.6);
  box-shadow: 0 16px 32px -8px rgba(1, 51, 122, 0.16), 0 0 20px rgba(10, 189, 255, 0.2);
}

.ris-video-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #091224;
  overflow: hidden;
}

.ris-video-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: block;
}

.ris-video-card:hover .ris-video-thumb-wrap img {
  transform: scale(1.08);
}

/* Overlay with Gradient & Play Button */
.ris-video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(1, 51, 122, 0.15) 0%, rgba(1, 51, 122, 0.75) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: all 0.3s ease;
}

.ris-video-card:hover .ris-video-overlay {
  opacity: 1;
  background: linear-gradient(180deg, rgba(10, 189, 255, 0.2) 0%, rgba(1, 51, 122, 0.85) 100%);
}

/* Pulsing Play Button */
.ris-play-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--ris-primary, #01337a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  padding-left: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  position: relative;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ris-play-btn::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  animation: risPlayPulse 2s infinite ease-in-out;
}

@keyframes risPlayPulse {
  0% {
    transform: scale(0.92);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.15);
    opacity: 0.2;
  }
  100% {
    transform: scale(0.92);
    opacity: 0.8;
  }
}

.ris-video-card:hover .ris-play-btn {
  transform: scale(1.15);
  background: var(--ris-cyan, #0abdff);
  color: #ffffff;
  box-shadow: 0 10px 30px rgba(10, 189, 255, 0.6);
}

/* Badge (YouTube / Facebook) */
.ris-video-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.ris-video-badge.yt {
  background: #e02424;
  color: #ffffff;
}

.ris-video-badge.fb {
  background: #1877f2;
  color: #ffffff;
}

/* Card Body */
.ris-video-card-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex: 1;
}

.ris-video-title {
  font-family: var(--ris-font-heading, 'Outfit', sans-serif);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ris-primary, #01337a);
  line-height: 1.4;
  margin: 0 0 10px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.ris-video-card:hover .ris-video-title {
  color: var(--ris-cyan-hover, #0097e3);
}

.ris-video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--ris-text-muted, #64748b);
  border-top: 1px solid var(--ris-border, #f1f5f9);
  padding-top: 10px;
  margin-top: auto;
}

.ris-video-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ris-video-watch-link {
  font-weight: 600;
  color: var(--ris-cyan, #0abdff);
  transition: transform 0.2s ease;
}

.ris-video-card:hover .ris-video-watch-link {
  transform: translateX(3px);
  color: var(--ris-primary, #01337a);
}

/* ==========================================================================
   Video Lightbox Modal
   ========================================================================== */
.ris-vpop-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.ris-vpop-modal.active {
  display: flex;
  opacity: 1;
  visibility: visible;
}

.ris-vpop-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 18, 38, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  cursor: pointer;
}

.ris-vpop-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  background: #0b1528;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 70px -10px rgba(0, 0, 0, 0.7), 0 0 30px rgba(10, 189, 255, 0.2);
  overflow: hidden;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.ris-vpop-modal.active .ris-vpop-container {
  transform: scale(1) translateY(0);
}

/* Modal Toolbar / Header */
.ris-vpop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #0f1c35;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  gap: 15px;
}

.ris-vpop-info {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ris-vpop-tag {
  background: rgba(10, 189, 255, 0.15);
  color: var(--ris-cyan, #0abdff);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(10, 189, 255, 0.3);
}

.ris-vpop-title {
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--ris-font-heading, 'Outfit', sans-serif);
}

.ris-vpop-counter {
  color: #94a3b8;
  font-size: 0.8rem;
  white-space: nowrap;
  font-weight: 500;
}

.ris-vpop-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ris-vpop-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.ris-vpop-btn:hover {
  background: var(--ris-cyan, #0abdff);
  border-color: var(--ris-cyan, #0abdff);
  color: #ffffff;
  transform: translateY(-1px);
}

.ris-vpop-close {
  background: rgba(220, 38, 38, 0.15);
  color: #ef4444;
  border-color: rgba(220, 38, 38, 0.3);
}

.ris-vpop-close:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
}

/* Modal Player Stage */
.ris-vpop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ris-vpop-stage iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  z-index: 2;
}

/* Stage Loader */
.ris-vpop-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #94a3b8;
  font-size: 0.88rem;
  z-index: 1;
}

.ris-vpop-spinner {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--ris-cyan, #0abdff);
  border-radius: 50%;
  animation: risSpin 0.8s linear infinite;
}

@keyframes risSpin {
  to { transform: rotate(360deg); }
}

/* Navigation Arrows (Prev / Next) */
.ris-vpop-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(1, 51, 122, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 10;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.ris-vpop-nav:hover {
  background: var(--ris-cyan, #0abdff);
  border-color: var(--ris-cyan, #0abdff);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(10, 189, 255, 0.4);
}

.ris-vpop-prev {
  left: 15px;
}

.ris-vpop-next {
  right: 15px;
}

/* Responsive Rules */
@media (max-width: 767px) {
  .ris-vpop-modal {
    padding: 10px;
  }
  .ris-vpop-header {
    padding: 10px 14px;
  }
  .ris-vpop-tag,
  .ris-vpop-counter {
    font-size: 0.7rem;
  }
  .ris-vpop-title {
    font-size: 0.85rem;
  }
  .ris-vpop-nav {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }
  .ris-vpop-prev {
    left: 8px;
  }
  .ris-vpop-next {
    right: 8px;
  }
}
