/* Slider wrapper */
.tmdbps-wrap {
  padding: 10px 0;
}

.tmdbps-swiper .swiper-button-prev,
.tmdbps-swiper .swiper-button-next {
  color: #2A511C;
}

.tmdbps-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.tmdbps-title {
  margin: 0;
  font-size: 22px;
}

.tmdbps-credit {
  font-size: 12px;
  opacity: .75;
}

/* Cards */
.tmdbps-card {
  width: 100%;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.tmdbps-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  object-position: center;
  border-radius: 12px;
  display: block;
}

.tmdbps-card-title {
  margin-top: 8px;
  font-size: 13px;
  opacity: .95;
}

.tmdbps-card-role {
  font-size: 12px;
  opacity: .8;
  margin-top: 2px;
}

.tmdbps-empty {
  height: 260px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .08);
}

/* Modal */
.tmdbps-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 14, 6, .72);
  backdrop-filter: blur(10px);
  z-index: 999999;
  padding: clamp(16px, 3vw, 36px);
  overflow-y: auto;
}

.tmdbps-modal.open {
  display: block
}

.tmdbps-modal-card {
  background: linear-gradient(180deg, #274718 0%, #1b3210 100%);
  color: #f5f3e7;
  max-width: 860px;
  margin: 0 auto;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, .08);
  overflow: hidden;
  position: relative;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .42);
}

.tmdbps-close {
  position: absolute;
  top: 18px;
  right: 18px;
  border: 1px solid rgba(255, 255, 255, .14);
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
  transition: background-color .2s ease, border-color .2s ease, transform .2s ease;
  z-index: 3;
}

.tmdbps-close:hover,
.tmdbps-close:focus {
  background: rgba(255, 255, 255, .2);
  border-color: #2A511C;
  outline: none;
  box-shadow: none;
  transform: translateY(-1px);
}

.tmdbps-close:focus-visible {
  border-color: #2A511C;
  outline: none;
  box-shadow: none;
}

.tmdbps-modal-body {
  padding: 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 243, 231, .35) transparent;
}

.tmdbps-modal-body::-webkit-scrollbar {
  width: 10px;
}

.tmdbps-modal-body::-webkit-scrollbar-thumb {
  background: rgba(245, 243, 231, .3);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

.tmdbps-noscroll {
  overflow: hidden
}

/* Top bar */
.tmdbps-topbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  margin: -18px -18px 22px;
  padding: 26px 24px 18px;
  padding-right: 112px;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, .12), transparent 34%),
    linear-gradient(180deg, rgba(14, 29, 8, .55), rgba(14, 29, 8, .22));
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.tmdbps-topbar-left {
  flex: 1 1 320px;
}

.tmdbps-topbar-right {
  display: flex;
  align-items: center;
}

.tmdbps-movie-title {
  font-size: clamp(28px, 4vw, 38px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.03em;
}

.tmdbps-movie-meta {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(245, 243, 231, .76);
  line-height: 1.5;
}

.tmdbps-rating {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(245, 243, 231, .12);
  background: rgba(245, 243, 231, .08);
  color: #f9efba;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Hero */
.tmdbps-hero {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.tmdbps-poster img {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  display: block;
  object-fit: cover;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .25);
}

.tmdbps-backdrop {
  position: relative;
  min-height: 320px;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06);
}

.tmdbps-backdrop:after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 18, 6, .05), rgba(8, 18, 6, .62)),
    linear-gradient(90deg, rgba(8, 18, 6, .52), transparent 48%);
  pointer-events: none;
}

.tmdbps-backdrop img {
  width: 100%;
  height: 100%;
  display: block;
  max-height: none;
  min-height: 320px;
  object-fit: cover;
}

/* Play button overlay */
.tmdbps-hero-play {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18);
  cursor: pointer;
  background: rgba(8, 18, 6, .45);
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
  transition: transform .2s ease, background-color .2s ease, border-color .2s ease;
  z-index: 1;
}

.tmdbps-hero-play:hover,
.tmdbps-hero-play:focus,
.tmdbps-hero-play:focus-visible {
  background: rgba(8, 18, 6, .62);
  border-color: #2A511C !important;
  outline: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
  transform: scale(1.04);
}

.tmdbps-hero-play:before {
  content: "";
  position: absolute;
  left: 25px;
  top: 19px;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid rgba(255, 255, 255, .95);
}

/* Sections */
.tmdbps-section {
  margin-top: 18px;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}

.tmdbps-section-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
  color: rgba(245, 243, 231, .72);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tmdbps-overview {
  color: rgba(245, 243, 231, .92);
  font-size: 15px;
  line-height: 1.7;
}

.tmdbps-myrole {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border-left: 3px solid rgba(249, 239, 186, .75);
  background: rgba(0, 0, 0, .14);
}

.tmdbps-mynotes {
  margin: 0 0 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .14);
}

.tmdbps-mynotes div {
  margin-top: 8px;
  opacity: .95;
  line-height: 1.6;
}

/* Videos strip */
.tmdbps-videos-strip {
  display: flex;
  gap: 10px;
  overflow: auto;
  padding: 8px 0 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 243, 231, .24) transparent;
}

.tmdbps-video-thumb {
  border: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  padding: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-align: left;
  cursor: pointer;
  width: 172px;
  flex: 0 0 auto;
  transition: transform .2s ease, opacity .2s ease;
}

.tmdbps-video-thumb:hover,
.tmdbps-video-thumb:focus,
.tmdbps-video-thumb:active {
  background: transparent !important;
  background-color: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  transform: translateY(-2px);
}

.tmdbps-video-thumb img {
  width: 100%;
  border-radius: 14px;
  display: block;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .2);
}

.tmdbps-video-thumb-title {
  font-size: 12px;
  margin-top: 8px;
  color: rgba(245, 243, 231, .84);
  line-height: 1.35;
}

/* Cast */
.tmdbps-cast-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.tmdbps-cast-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.tmdbps-cast-toggle {
  border: 1px solid rgba(255, 255, 255, .1);
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: background-color .2s ease, transform .2s ease;
}

.tmdbps-cast-toggle:hover,
.tmdbps-cast-toggle:focus {
  background: rgba(255, 255, 255, .14);
  transform: translateY(-1px);
}

.tmdbps-cast-link {
  color: #e7f5d2;
  font-size: 12px;
  opacity: .92;
  text-decoration: none;
}

.tmdbps-cast-link:hover,
.tmdbps-cast-link:focus {
  text-decoration: underline;
}

.tmdbps-cast {
  margin-top: 14px;
}

.tmdbps-cast-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, .14);
}

.tmdbps-cast-row + .tmdbps-cast-row {
  margin-top: 10px;
}

.tmdbps-cast-name {
  font-weight: 600;
  color: #fff;
}

.tmdbps-cast-role {
  color: rgba(245, 243, 231, .72);
  text-align: right;
}

.tmdbps-cast-full {
  display: none
}

.tmdbps-cast-block.is-expanded .tmdbps-cast-full {
  display: block
}

.tmdbps-cast-block.is-expanded .tmdbps-cast-short {
  display: none
}

/* Footer */
.tmdbps-foot {
  margin-top: 18px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(8, 18, 6, .35);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tmdbps-foot > div {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
}

@media (max-width: 900px) {
  .tmdbps-topbar {
    padding-right: 88px;
  }

  .tmdbps-hero {
    grid-template-columns: 1fr;
  }

  .tmdbps-poster {
    max-width: 240px;
  }

  .tmdbps-backdrop,
  .tmdbps-backdrop img {
    min-height: 240px;
  }
}

@media (max-width: 640px) {
  .tmdbps-modal {
    padding: 12px;
  }

  .tmdbps-modal-card {
    border-radius: 20px;
    max-height: calc(100vh - 24px);
  }

  .tmdbps-close {
    top: 12px;
    right: 12px;
    padding: 9px 12px;
  }

  .tmdbps-modal-body {
    padding: 14px;
  }

  .tmdbps-topbar {
    margin: -14px -14px 18px;
    padding: 18px 18px 16px;
    padding-right: 78px;
  }

  .tmdbps-movie-title {
    font-size: 24px;
  }

  .tmdbps-section,
  .tmdbps-foot {
    padding: 16px;
  }

  .tmdbps-cast-row,
  .tmdbps-foot {
    grid-template-columns: 1fr;
  }

  .tmdbps-cast-role {
    text-align: left;
  }

  .tmdbps-video-thumb {
    width: 210px;
  }
}

/* Video overlay */
.tmdbps-video-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(0, 0, 0, .7);
  padding: 24px
}

.tmdbps-video-overlay.open {
  display: block
}

.tmdbps-video-card {
  background: #fff;
  max-width: 900px;
  margin: 8vh auto 0;
  border-radius: 14px;
  overflow: hidden;
  position: relative
}

.tmdbps-video-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 10px;
  background: rgba(0, 0, 0, .08);
  z-index: 2
}

.tmdbps-video-frame-wrap {
  aspect-ratio: 16/9
}

.tmdbps-video-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block
}

/* Remove hover effects */
.tmdbps-card:hover,
.tmdbps-card:focus {
  background: transparent !important;
  color: inherit !important;
}

.tmdbps-title:hover {
  color: inherit !important;
  background: transparent !important;
}

.tmdbps-credit:hover {
  color: inherit !important;
  background: transparent !important;
}
