/* ======================================================
   1. ROOT / VARIABLES
====================================================== */

.ypc-wrapper {
  --ypc-columns: 1;
  position: relative;
  overflow: hidden;
  padding: 30px 0;
  margin: -30px 0;
}


/* ======================================================
   2. CORE CAROUSEL LAYOUT
====================================================== */

.ypc-track {
  display: flex;
  gap: 12px;
  touch-action: pan-y;
}

.ypc-slide {
  position: relative;
  flex: 0 0 calc(
    (100% - (12px * (var(--ypc-columns) - 1)))
    / var(--ypc-columns)
  );
  box-sizing: border-box;
  max-width: 100%;
}

.ypc-slide-inner {
  width: 100%;
  position: relative;
  transition: transform 0.3s ease;
}


/* ======================================================
   3. VIDEO WRAPPER / ASPECT RATIO
====================================================== */

.ypc-video-wrap {
  position: relative;
  width: 100%;
  background: #000;
  overflow: hidden;
  transform: translateZ(0);
  transition: box-shadow 0.3s ease;
}

.ypc-video-wrap::before {
  content: "";
  display: block;
  padding-top: 56.25%; /* 16:9 */
}

/* Portrait */
.ypc-wrapper.aspect-9-16 .ypc-video-wrap::before {
  padding-top: 177.77%;
}

.ypc-video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  z-index: 1;
}


/* ======================================================
   4. THUMBNAIL / PLAY UI
====================================================== */

.ypc-thumbnail {
  position: absolute;
  inset: 0;
  z-index: 3;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: opacity .25s ease;
}

.ypc-thumbnail.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.ypc-play-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

/* Play Button Circle */
.ypc-play-icon::before {
  content: '';
  width: 68px;
  height: 68px;
  background: rgba(0,0,0,.6);
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
}

.ypc-thumbnail:hover .ypc-play-icon::before {
  transform: scale(1.1);
  background: rgba(204, 0, 0, 0.85);
}

/* Play Icon Triangle */
.ypc-play-icon::after {
  content: '';
  position: absolute;
  margin-left: 4px;
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff;
}


/* ======================================================
   5. LOADING SPINNER
====================================================== */

.ypc-spinner {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease;
}

.ypc-spinner.is-visible {
  opacity: 1;
}

.ypc-spinner::before {
  content: "";
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.18);
  border-top-color: #fff;
  animation: ypc-spin 1s linear infinite;
}

@keyframes ypc-spin {
  to { transform: rotate(360deg); }
}


/* ======================================================
   6. VIDEO TITLE
====================================================== */

.ypc-video-title {
  margin: 10px 0 0;
  padding: 0;
  font-size: 16px;
  line-height: 1.3;
  color: #fff;
  white-space: normal;
  display: block;
}


/* ======================================================
   7. BADGES / LABELS
====================================================== */

.ypc-badge {
  pointer-events: none;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1;
}


/* === Badge Presets === */

/* Hot */
.ypc-badge-preset-hot {
  background: #ff0000 !important;
  color: #fff !important;
  border-radius: 2px !important;
  box-shadow: 0 2px 5px rgba(255,0,0,0.4);
}

/* New */
.ypc-badge-preset-new {
  background: #00d2b4 !important;
  color: #fff !important;
  border-radius: 20px !important;
  padding: 5px 10px !important;
}

/* Premium */
.ypc-badge-preset-premium {
  background: linear-gradient(45deg,#FFD700,#DAA520) !important;
  color: #000 !important;
  border: 1px solid #000;
  border-radius: 4px !important;
  font-weight: 800 !important;
}

/* Dark */
.ypc-badge-preset-dark {
  background: #111 !important;
  color: #fff !important;
  border: 1px solid #333;
  border-radius: 4px !important;
}

/* Outline */
.ypc-badge-preset-outline {
  background: transparent !important;
  border: 2px solid #fff !important;
  color: #fff !important;
  border-radius: 4px !important;
}


/* ======================================================
   8. CARD STYLES
====================================================== */

.ypc-style-card .ypc-slide-inner {
  overflow: hidden;
}


/* ======================================================
   9. SHADOW PRESETS
====================================================== */

.ypc-shadow-soft .ypc-video-wrap {
  box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

.ypc-shadow-deep .ypc-video-wrap {
  box-shadow: 0 15px 35px rgba(0,0,0,0.35);
}

.ypc-shadow-perspective .ypc-slide-inner::after {
  content: "";
  position: absolute;
  z-index: -1;
  bottom: 0;
  left: 5%;
  right: 5%;
  height: 20px;
  border-radius: 100%;
  background: rgba(0,0,0,0.45);
  filter: blur(12px);
  transform: translateY(5px) scale(0.95);
  transition: all 0.3s ease;
}

.ypc-shadow-perspective .ypc-slide-inner:hover {
  transform: translateY(-5px);
}

.ypc-shadow-perspective .ypc-slide-inner:hover::after {
  transform: translateY(15px) scale(1);
  background: rgba(0,0,0,0.25);
}


/* ======================================================
   10. NAVIGATION ARROWS
====================================================== */

.ypc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  cursor: pointer;
  border: none;
  padding: 0;
  line-height: 1;
  transition: all .2s ease;
}

.ypc-prev { left: 10px; }
.ypc-next { right: 10px; }

.ypc-arrow:hover {
  opacity: 1 !important;
  transform: translateY(-50%) scale(1.1);
}


/* ======================================================
   11. RESPONSIVE (MOBILE / TABLET)
====================================================== */

@media (max-width: 1024px) {

  .ypc-arrow {
    display: none !important;
  }

  .ypc-wrapper {
    --ypc-columns: 1;
  }

  .ypc-slide {
    flex: 0 0 100%;
    width: 100%;
  }

}


/* Duration Badge */
.ypc-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 3px 4px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 2px;
  line-height: 1;
  pointer-events: none;
  z-index: 5;
  letter-spacing: 0.5px;
}