/* ==========================================================================
   Design 4: Interactive Expanding Spotlight + Vertical Real Poster Shelf
   Hovering any card expands it into the Wide Spotlight Card while collapsing
   the previously active card (including Card #1) into a crisp Vertical Poster.
   ========================================================================== */

.spotlight-shelf-section {
    --spot-rgb: 52, 211, 153;
    --spot-accent: #34d399;
    --spot-surface: #1e1f27;
    --spot-border: rgba(255, 255, 255, 0.08);
    --spot-text: #f4f5f9;
    --spot-muted: #9ca3b5;
    width: 94%;
    margin: 26px auto 34px;
    direction: rtl;
    font-family: 'IRANYekanX', 'Vazirmatn', system-ui, sans-serif;
    box-sizing: border-box;
}

.spotlight-shelf-section.is-completed {
    --spot-rgb: 251, 191, 36;
    --spot-accent: #fbbf24;
}

/* Header */
.spotlight-shelf-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.spotlight-shelf-heading {
    text-align: right;
    min-width: 0;
}

.spotlight-shelf-section .spotlight-shelf-title {
    margin: 0 !important;
    color: var(--spot-text) !important;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif !important;
    font-size: 17px !important;
    font-weight: 800 !important;
    line-height: 1.4 !important;
}

.spotlight-shelf-section .spotlight-shelf-subtitle {
    margin: 2px 0 0 !important;
    color: var(--spot-muted) !important;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    line-height: 1.65 !important;
}

/* Controls: [ › ] [ مشاهده همه ← ] [ ‹ ] */
.spotlight-shelf-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    direction: rtl;
}

.spotlight-arrow-btn,
.spotlight-view-all-btn {
    height: 36px;
    box-sizing: border-box;
    border-radius: 12px;
    background: var(--spot-surface);
    border: 1px solid var(--spot-border);
    color: var(--spot-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.2s ease, border-color 0.2s ease;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    user-select: none;
}

.spotlight-arrow-btn {
    width: 36px;
    padding: 0;
}

.spotlight-arrow-btn svg {
    width: 15px;
    height: 15px;
    display: block;
}

.spotlight-view-all-btn {
    padding: 0 15px;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.spotlight-view-all-btn .spotlight-arrow-left {
    color: var(--spot-accent);
    font-size: 13px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.spotlight-arrow-btn:not(:disabled):hover,
.spotlight-view-all-btn:hover {
    background: rgba(var(--spot-rgb), 0.13);
    border-color: rgba(var(--spot-rgb), 0.42);
    color: var(--spot-text);
}

.spotlight-view-all-btn:hover .spotlight-arrow-left {
    transform: translateX(-3px);
}

.spotlight-arrow-btn:disabled {
    opacity: 0.34;
    cursor: default;
    pointer-events: none;
}

/* Embla Track */
.spotlight-embla.embla {
    overflow: hidden;
    padding: 4px 2px 25px;
}

.spotlight-container.embla__container {
    display: flex;
    align-items: stretch;
}

/* ==========================================================================
   Unified Interactive Spotlight / Poster Card (`.spotlight-expand-card`)
   ========================================================================== */
.spotlight-shelf-section .spotlight-expand-card.embla__slide {
    flex: 0 0 166px;
    width: 166px;
    height: 256px;
    margin-left: 16px;
    padding: 0;
    gap: 0;
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-radius: 22px;
    background: #12141c;
    border: 1px solid var(--spot-border);
    text-decoration: none !important;
    overflow: hidden;
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.65);
    transition:
        flex-basis 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        padding 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        gap 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.28s ease,
        box-shadow 0.28s ease,
        transform 0.24s ease;
    will-change: flex-basis, width;
}

/* Expanded State (Active Card — default #1 or currently hovered card) */
.spotlight-shelf-section .spotlight-expand-card.is-expanded.embla__slide {
    flex: 0 0 356px;
    width: 356px;
    padding: 14px;
    gap: 16px;
    background: #13151d;
    border-color: rgba(var(--spot-rgb), 0.42);
    box-shadow: 0 18px 36px -12px rgba(0, 0, 0, 0.8), 0 0 24px rgba(var(--spot-rgb), 0.14);
}

.spotlight-shelf-section .spotlight-expand-card.is-expanded.embla__slide:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--spot-rgb), 0.65);
}

/* Blurred Backdrop & Veil (visible only when expanded) */
.spotlight-hero-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(26px) saturate(1.35);
    transform: scale(1.25);
    opacity: 0;
    pointer-events: none;
    z-index: 0;
    transition: opacity 0.36s ease;
}

.spotlight-expand-card.is-expanded .spotlight-hero-backdrop {
    opacity: 0.38;
}

.spotlight-hero-veil {
    position: absolute;
    inset: 0;
    background: linear-gradient(270deg, rgba(0, 0, 0, 0.52) 0%, rgba(0, 0, 0, 0.72) 55%, rgba(0, 0, 0, 0.86) 100%);
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.36s ease;
}

.spotlight-expand-card.is-expanded .spotlight-hero-veil {
    opacity: 1;
}

/* Morphing Poster Frame: 166x256 (collapsed) <-> 152x228 (expanded) */
.spotlight-shelf-section .spotlight-expand-card .spotlight-hero-poster {
    position: relative;
    z-index: 2;
    width: 166px;
    height: 256px;
    border-radius: 21px;
    overflow: hidden;
    flex-shrink: 0;
    background: #0b0d14;
    box-shadow: none;
    transition:
        width 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        border-radius 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.32s ease;
}

.spotlight-shelf-section .spotlight-expand-card.is-expanded .spotlight-hero-poster {
    width: 152px;
    height: 228px;
    border-radius: 16px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.6);
}

.spotlight-hero-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.spotlight-shelf-section .spotlight-expand-card.is-expanded:hover .spotlight-hero-poster img {
    transform: scale(1.05);
}

/* Collapsed Top Shade & Mini Badges (fade out smoothly when expanded) */
.spotlight-expand-card .spotlight-poster-top-shade,
.spotlight-expand-card .spotlight-poster-badges {
    transition: opacity 0.24s ease;
}

.spotlight-expand-card.is-expanded .spotlight-poster-top-shade,
.spotlight-expand-card.is-expanded .spotlight-poster-badges {
    opacity: 0;
    pointer-events: none;
}

/* Spotlight Details Panel (fixed 160px inner width so text never squishes while morphing) */
.spotlight-shelf-section .spotlight-expand-card .spotlight-hero-body {
    position: relative;
    z-index: 2;
    width: 160px;
    min-width: 160px;
    height: 228px;
    flex: 0 0 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 4px 0;
    box-sizing: border-box;
    text-align: right;
    opacity: 0;
    transform: translateX(12px);
    pointer-events: none;
    transition:
        opacity 0.28s ease,
        transform 0.36s cubic-bezier(0.22, 1, 0.36, 1);
}

.spotlight-shelf-section .spotlight-expand-card.is-expanded .spotlight-hero-body {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    transition-delay: 0.06s;
}

.spotlight-hero-top {
    min-width: 0;
}

.spotlight-featured-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    background: var(--spot-accent);
    color: #090d16;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
}

.spotlight-shelf-section .spotlight-hero-title {
    margin: 9px 0 6px !important;
    color: #ffffff !important;
    font-family: 'Kalame', 'kalame', sans-serif !important;
    font-size: 19px !important;
    font-weight: 700 !important;
    line-height: 1.24 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotlight-shelf-section .spotlight-hero-title.is-ltr {
    direction: ltr;
    text-align: left;
}

.spotlight-shelf-section .spotlight-hero-title.is-rtl {
    direction: rtl;
    text-align: right;
}

.spotlight-hero-meta {
    color: #cbd5e1;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotlight-hero-rating {
    margin-top: 6px;
    color: #fcd34d;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.spotlight-hero-bottom {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spotlight-hero-ep {
    color: #e2e8f0;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.spotlight-hero-cta {
    width: 100%;
    padding: 8px 0;
    border-radius: 12px;
    background: var(--spot-accent);
    color: #090d16;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    font-size: 12px;
    font-weight: 900;
    line-height: 1.4;
    transition: filter 0.2s ease;
}

.spotlight-shelf-section .spotlight-expand-card.is-expanded:hover .spotlight-hero-cta {
    filter: brightness(1.08);
}

.spotlight-play-icon {
    width: 10px;
    height: 10px;
    display: block;
}

/* Standalone Vertical Poster Cards (used in Archive / Search / Bookmark grids) */
.spotlight-poster-card {
    position: relative;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #12141c;
    overflow: hidden;
    text-decoration: none !important;
    box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.65);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.spotlight-poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.spotlight-poster-top-shade {
    position: absolute;
    inset: 0 0 auto 0;
    height: 64px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.66) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

.spotlight-poster-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    z-index: 3;
}

.spotlight-mini-badge {
    padding: 2px 8px;
    border-radius: 6px;
    background: var(--spot-accent, #34d399);
    color: #090d16;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.45;
}

.spotlight-ep-pill {
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    color: #ffffff;
    font-family: 'Segoe UI', system-ui, sans-serif;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.45;
}

.spotlight-poster-hover {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.78) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 12px;
    opacity: 0;
    transition: opacity 0.24s ease;
    z-index: 2;
}

.spotlight-poster-card:hover .spotlight-poster-hover {
    opacity: 1;
}

.spotlight-poster-hover-title {
    color: #ffffff;
    font-family: 'Kalame', 'kalame', 'IRANYekanX', sans-serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.22;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spotlight-poster-hover-title.is-ltr {
    direction: ltr;
    text-align: left;
}

.spotlight-poster-hover-title.is-rtl {
    direction: rtl;
    text-align: right;
}

.spotlight-poster-hover-sub {
    margin-top: 3px;
    color: #cbd5e1;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    font-size: 11.5px;
    font-weight: 400;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Day (Light) Theme Overrides */
.day .spotlight-shelf-section {
    --spot-surface: #ffffff;
    --spot-border: rgba(15, 23, 42, 0.1);
    --spot-text: #141824;
    --spot-muted: #555f75;
}

.day .spotlight-view-all-btn .spotlight-arrow-left {
    color: #059669;
}

.day .spotlight-shelf-section.is-completed .spotlight-view-all-btn .spotlight-arrow-left {
    color: #d97706;
}

@media (max-width: 760px) {
    .spotlight-shelf-section .spotlight-expand-card.embla__slide {
        flex: 0 0 152px;
        width: 152px;
        height: 236px;
        margin-left: 12px;
    }

    .spotlight-shelf-section .spotlight-expand-card .spotlight-hero-poster {
        width: 152px;
        height: 236px;
    }

    .spotlight-shelf-section .spotlight-expand-card.is-expanded.embla__slide {
        flex: 0 0 315px;
        width: 315px;
        height: 236px;
    }

    .spotlight-shelf-section .spotlight-expand-card.is-expanded .spotlight-hero-poster {
        width: 134px;
        height: 208px;
    }

    .spotlight-shelf-section .spotlight-expand-card .spotlight-hero-body {
        width: 137px;
        min-width: 137px;
        flex: 0 0 137px;
        height: 208px;
    }
}
