/* Core Grid and Card Styles */
.rkd-video-gallery-container {
  font-family: inherit;
  background-color: #ffffff;
  padding: 20px 0;
}

.rkd-video-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

@media (max-width: 991px) {
  .rkd-video-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .rkd-video-gallery-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Video Card Styling */
.rkd-video-gallery-card {
  background-color: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: transform 300ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 300ms ease;
  outline: none;
}

.rkd-video-gallery-card:focus-visible {
  outline: 3px solid #e53e3e;
  outline-offset: 3px;
}

.rkd-video-gallery-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.rkd-video-gallery-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
  background-color: #111111;
}

.rkd-video-gallery-img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 450ms cubic-bezier(0.16, 1, 0.3, 1);
}

.rkd-video-gallery-card:hover .rkd-video-gallery-img {
  transform: scale(1.06);
}

.rkd-video-gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.15);
  transition: background-color 300ms ease;
}

.rkd-video-gallery-card:hover .rkd-video-gallery-overlay {
  background: rgba(0, 0, 0, 0.3);
}

/* Play Button */
.rkd-video-gallery-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: background-color 300ms ease, transform 300ms cubic-bezier(0.16, 1, 0.3, 1);
}

.rkd-video-gallery-play-svg {
  width: 26px;
  height: 26px;
  margin-left: 3px;
}

.rkd-video-gallery-card:hover .rkd-video-gallery-play-btn {
  transform: translate(-50%, -50%) scale(1.1);
}

.rkd-video-gallery-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
}

.rkd-video-gallery-info {
  padding: 15px 20px;
}

.rkd-video-gallery-card-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.4;
  font-weight: 700;
  transition: color 250ms ease;
}

/* LIGHTBOX STYLING */
.rkd-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.95);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms ease, visibility 300ms ease;
  backdrop-filter: blur(5px);
  box-sizing: border-box;
}

body.admin-bar .rkd-lightbox-overlay {
  top: var(--wp-admin--admin-bar--height, 32px);
}

.rkd-lightbox-overlay.rkd-active {
  opacity: 1;
  visibility: visible;
}

.rkd-lightbox-wrapper {
  width: 92%;
  max-width: 1200px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  position: relative;
  color: #ffffff;
  box-sizing: border-box;
}

/* Lightbox Body Grid */
.rkd-lightbox-grid {
  display: grid;
  grid-template-columns: 7fr 3fr;
  flex: 1;
  background: #141414;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.rkd-lightbox-video-panel {
  background: #000000;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rkd-lightbox-video-frame {
  width: 100%;
  height: 100%;
  aspect-ratio: 16/9;
  border: none;
}

.rkd-lightbox-video-tag {
  width: 100%;
  height: 100%;
  outline: none;
}

/* Info Sidebar */
.rkd-lightbox-info-panel {
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #181818;
  overflow-y: auto;
  border-left: 1px solid #222222;
}

.rkd-lightbox-info-top {
  margin-bottom: 25px;
}

.rkd-lightbox-cat {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #e53e3e;
  font-weight: 700;
  display: block;
  margin-bottom: 10px;
}

.rkd-lightbox-title {
  margin: 0 0 15px 0;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
}

.rkd-lightbox-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #cccccc;
}

.rkd-lightbox-action-btn {
  display: inline-block;
  background-color: #e53e3e;
  color: #ffffff;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  align-self: flex-start;
  transition: background-color 250ms ease;
  margin-top: 15px;
}

.rkd-lightbox-action-btn:hover {
  background-color: #c53030;
  color: #ffffff;
}

/* Left / Right Nav Arrows */
.rkd-lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(30, 30, 30, 0.8);
  border: 1px solid #333333;
  color: #ffffff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 250ms ease, border-color 250ms ease;
  z-index: 10;
}

.rkd-lightbox-arrow:hover {
  background: #e53e3e;
  border-color: #e53e3e;
}

.rkd-lightbox-arrow svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.rkd-lightbox-arrow-left {
  left: -70px;
}

.rkd-lightbox-arrow-right {
  right: -70px;
}

/* Close Button */
.rkd-lightbox-close {
  position: absolute;
  top: -45px;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  transition: color 250ms ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.rkd-lightbox-close:hover {
  color: #e53e3e;
}

.rkd-lightbox-close svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* THUMBNAILS HORIZONTAL SCROLL LIST */
.rkd-lightbox-carousel-wrap {
  margin-top: 20px;
  position: relative;
  display: flex;
  align-items: center;
}

.rkd-lightbox-carousel-container {
  overflow-x: auto;
  scroll-behavior: smooth;
  display: flex;
  gap: 15px;
  width: 100%;
  padding: 5px 0 10px 0;
  scrollbar-width: none; /* Firefox */
}

.rkd-lightbox-carousel-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.rkd-lightbox-carousel-item {
  flex: 0 0 160px;
  width: 160px;
  min-width: 160px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 300ms ease, transform 300ms ease;
}

.rkd-lightbox-carousel-item:hover,
.rkd-lightbox-carousel-item.rkd-active {
  opacity: 1;
}

.rkd-lightbox-carousel-item.rkd-active {
  transform: scale(1.03);
}

.rkd-lightbox-carousel-thumb {
  display: block;
  width: 100%;
  height: 90px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  border-radius: 6px;
  border: 2px solid transparent;
  transition: border-color 300ms ease;
  box-sizing: border-box;
}

.rkd-lightbox-carousel-item.rkd-active .rkd-lightbox-carousel-thumb {
  border-color: #e53e3e;
}

.rkd-lightbox-carousel-title {
  font-size: 0.75rem;
  margin-top: 5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #bbbbbb;
}

.rkd-lightbox-carousel-item.rkd-active .rkd-lightbox-carousel-title {
  color: #ffffff;
  font-weight: 700;
}

/* Scroll Indicators/Arrows for horizontal list */
.rkd-carousel-btn {
  background: rgba(30, 30, 30, 0.9);
  border: 1px solid #333333;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  position: absolute;
  top: calc(50% - 10px);
  transform: translateY(-50%);
  transition: background-color 200ms ease;
}

.rkd-carousel-btn:hover {
  background: #e53e3e;
  border-color: #e53e3e;
}

.rkd-carousel-btn-left {
  left: -40px;
}

.rkd-carousel-btn-right {
  right: -40px;
}

.rkd-carousel-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Prevent Body Scroll */
body.rkd-lightbox-open {
  overflow: hidden !important;
}

/* RESPONSIVE LIGHTBOX ADJUSTMENTS */
@media (max-width: 1024px) {
  .rkd-lightbox-arrow-left {
    left: -15px;
    background: rgba(20, 20, 20, 0.9);
  }
  .rkd-lightbox-arrow-right {
    right: -15px;
    background: rgba(20, 20, 20, 0.9);
  }
  .rkd-carousel-btn-left { left: -10px; }
  .rkd-carousel-btn-right { right: -10px; }
}

@media (max-width: 768px) {
  .rkd-lightbox-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    overflow-y: auto;
  }
  
  .rkd-lightbox-wrapper {
    height: 90vh;
  }

  .rkd-lightbox-info-panel {
    padding: 20px;
    border-left: none;
    border-top: 1px solid #222222;
  }

  .rkd-lightbox-title {
    font-size: 1.25rem;
  }
  
  .rkd-lightbox-arrow {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 767px) {
  .rkd-lightbox-carousel-item {
    flex: 0 0 120px;
    width: 120px;
    min-width: 120px;
  }
  .rkd-lightbox-carousel-thumb {
    height: 67.5px;
  }
}

@media (max-width: 480px) {
  .rkd-lightbox-wrapper {
    height: 95vh;
  }
  
  .rkd-lightbox-close {
    top: -40px;
    right: 5px;
  }
  
  .rkd-lightbox-arrow {
    background: rgba(20, 20, 20, 0.95);
  }
}
