/* =============================================
   Spotify Showcase Block — Frontend Styles
   ============================================= */

/* ── Reset dalam scope block ── */
.ssb-block *,
.ssb-block *::before,
.ssb-block *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Block wrapper ── */
.ssb-block {
  --ssb-accent:   #1DB954;
  --ssb-bg:       #0f1f3d;
  --ssb-text:     #ffffff;
  --ssb-muted:    rgba(255,255,255,0.6);
  --ssb-card-bg:  rgba(255,255,255,0.06);
  --ssb-radius:   14px;
  --ssb-ep-radius: 10px;

  font-family: 'Circular', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: var(--ssb-text);
  width: 100%;
}

.ssb-inner {
  background: var(--ssb-bg);
  border-radius: var(--ssb-radius);
  padding: 20px 24px 24px;
  overflow: hidden;
}

/* ── Header ── */
.ssb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 8px;
}

.ssb-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ssb-text);
}

.ssb-spotify-icon {
  width: 18px;
  height: 18px;
  fill: var(--ssb-text);
  flex-shrink: 0;
}

.ssb-open-spotify {
  font-size: 13px;
  font-weight: 600;
  color: var(--ssb-text);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
}

.ssb-open-spotify:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ── Body layout ── */
.ssb-body {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow: hidden;
}

/* ── Show Info panel ── */
.ssb-show-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-shrink: 0;
  width: 260px;
  padding-right: 20px;
}

.ssb-cover-wrap {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}

.ssb-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ssb-show-meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.ssb-show-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ssb-text);
}

.ssb-follow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 14px;
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.2s, background 0.2s;
  width: fit-content;
}

.ssb-show-meta a.ssb-follow-btn {
  color: white!important;
}

.ssb-follow-btn:hover {
  border-color: var(--ssb-text);
  background: rgba(255,255,255,0.08);
}

.ssb-spotify-logo {
  width: 28px;
  height: 28px;
  opacity: 0.75;
}

.ssb-spotify-logo svg {
  width: 100%;
  height: 100%;
  fill: var(--ssb-text);
}

/* ── Divider ── */
.ssb-divider {
  width: 1px;
  background: rgba(255,255,255,0.12);
  flex-shrink: 0;
  align-self: stretch;
  margin: 0 4px;
}

/* ── Episodes container ── */
.ssb-episodes {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex: 1;
  overflow-x: auto;
  padding: 4px 0 4px 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.ssb-episodes .ssb-ep-content{
  display: flex;
  gap: 10px;
  /* justify-content: space-between; */
}

.ssb-episodes::-webkit-scrollbar {
  display: none;
}

/* ── Single episode card ── */
.ssb-episode {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  width: 160px;
  scroll-snap-align: start;
  cursor: default;
}

.ssb-episode--playable {
  cursor: pointer;
}

/* ── Episode thumbnail ── */
.ssb-ep-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--ssb-ep-radius);
  overflow: hidden;
  background: rgba(255,255,255,0.08);
}

.ssb-ep-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.ssb-episode--playable:hover .ssb-ep-thumb {
  transform: scale(1.04);
}

.ssb-ep-thumb--empty {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.08);
}

.ssb-ep-duration {
  position: absolute;
  bottom: 6px;
  right: 7px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.55);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.02em;
}

/* ── Play button ── */
.ssb-play-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  width: fit-content;
  transition: transform 0.18s ease;
}

.ssb-play-btn:hover {
  transform: scale(1.08);
}

.ssb-play-btn:focus-visible {
  outline: 2px solid var(--ssb-accent);
  outline-offset: 3px;
  border-radius: 50%;
}

.ssb-play-icon {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
  flex-shrink: 0;
}

/* ── Episode info text ── */
.ssb-ep-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ssb-ep-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ssb-muted);
}

.ssb-ep-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ssb-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.ssb-ep-subtitle {
  font-size: 11px;
  color: var(--ssb-muted);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* =============================================
   Arrow Navigation
   ============================================= */

.ssb-episodes-outer {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.ssb-arrow {
  position: absolute;
  z-index: 10;
      top: 38%;
    transform: translateY(-20%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, opacity 0.2s, transform 0.2s;
  padding: 0;
}

.ssb-arrow:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: translateY(-50%) scale(1.08);
}

.ssb-arrow:focus-visible {
  outline: 2px solid var(--ssb-accent);
  outline-offset: 2px;
}

.ssb-arrow[hidden] {
  display: none !important;
}

.ssb-arrow svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.ssb-arrow--prev {
  left: 4px;
}

.ssb-arrow--next {
  right: 4px;
}

/* Padding episodes agar tidak tertutup arrow */
.ssb-episodes-outer:has(.ssb-arrow--prev:not([hidden])) .ssb-episodes {
  padding-left: 48px;
}

.ssb-episodes-outer .ssb-episodes {
  padding-right: 48px;
}

/* Fallback :has() untuk browser lama */
@supports not selector(:has(a)) {
  .ssb-episodes {
    padding-left: 48px;
    padding-right: 48px;
  }
}

/* =============================================
   Lightbox
   ============================================= */

.ssb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ssb-lightbox[hidden] {
  display: none !important;
}

.ssb-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
}

.ssb-lightbox-box {
  position: relative;
  z-index: 1;
  background: #121212;
  border-radius: 16px;
  width: 100%;
  max-width: 640px;
  overflow: hidden;
  box-shadow:
    0 24px 80px rgba(0,0,0,0.7),
    0 0 0 1px rgba(255,255,255,0.07);
  animation: ssb-modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes ssb-modal-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.ssb-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.ssb-lightbox-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 48px);
}

.ssb-lightbox-close {
  background: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.ssb-lightbox-close:hover {
  background: rgba(255,255,255,0.2);
}

.ssb-lightbox-close svg {
  width: 16px;
  height: 16px;
  stroke: #fff;
}

.ssb-lightbox-player {
  padding: 0;
  line-height: 0;
}

.ssb-lightbox-player iframe {
  display: block;
  width: 100%;
  height: 352px;
  border: none;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 768px) {
  .ssb-inner {
    padding: 16px;
  }

  .ssb-header {
    display: none;
  }

  .ssb-show-title{
    font-size: 18px!important;
  }

  .ssb-body {
    gap: 16px;
  }

  .ssb-divider {
    display: none;
  }

  .ssb-lightbox-player iframe {
    height: 280px;
  }

  /* Arrow lebih kecil di tablet */
  .ssb-arrow {
    width: 30px;
    height: 30px;
  }

  .ssb-arrow svg {
    width: 14px;
    height: 14px;
  }
}

@media (max-width: 480px) {

  .ssb-play-icon {
    width: 16px;
    height: 16px;
  }

  .ssb-body {
    flex-direction: column;
  }
  .ssb-episode {
    width: 100%;
  }
  .ssb-episodes {
    /* padding-left: 0; */
    flex-direction: column;
    gap: 14px;
    padding: 0;
    max-height: 250px;
    overflow-y: scroll;
  }

  .ssb-episode {
    width: 100%px;
    flex-direction: row;
  }

  .ssb-ep-thumb-wrap {
    width: 90px;
    flex-shrink: 0;
  }

  .ssb-play-btn:not(.ssb-play-btn--thumb) {
    display: none;
  }

  .ssb-show-info {
    flex-direction: row;
    width: 100%;
    padding-right: 0;
    align-items: center;
  }

  .ssb-show-meta{
    flex-direction: row;
    width: 100%;
    flex-wrap: wrap;
  }

  .ssb-cover-wrap {
    display: none;
  }

  /* Arrow disembunyikan di mobile — pakai scroll vertikal */
  .ssb-arrow {
    display: none !important;
  }

  .ssb-episodes-outer .ssb-episodes {
    padding-right: 0;
  }
}

.ssb-arrow{
    background-color: white;
    color: black;
}