/* ========================================
   מילנר TV — add-on: series episodes + next-episode card
   Tokens come from css/styles.css.
   ======================================== */

/* ----- Episode list: loading / error / empty ----- */
.fx-series-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 48px 20px;
    text-align: center;
    grid-column: 1 / -1;
}

.fx-series-status-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* ----- Episode row: progress / duration line ----- */
.fx-ep-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 0;
}

.fx-ep-bar {
    position: relative;
    flex: 0 0 56px;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.fx-ep-bar-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    inset-inline-start: 0;
    background: var(--primary-light);
    border-radius: 2px;
}

.fx-ep-meta-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----- "Up next" card inside the player ----- */
.fx-next-ep {
    position: absolute;
    bottom: 16px;
    inset-inline-end: 16px;
    z-index: 9;
    width: min(300px, calc(100% - 32px));
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    background: rgba(17, 17, 17, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    color: #fff;
    transition: opacity 0.3s ease, transform 0.3s var(--ease-out), bottom 0.35s var(--ease-out);
}

/* Lift above the floating control bar while it is shown */
#player-overlay.visible ~ .fx-next-ep {
    bottom: 118px;
}

.fx-next-ep--hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.fx-next-ep-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-light);
}

.fx-next-ep-title {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fx-next-ep-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
}

.fx-next-ep-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.fx-next-ep-actions .fx-btn:not(.fx-btn--primary) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
    color: #fff;
}

/* Small players: the control bar fills most of the height, so sit at the top */
@media (max-width: 560px) {
    .fx-next-ep,
    #player-overlay.visible ~ .fx-next-ep {
        top: 8px;
        bottom: auto;
        inset-inline-end: 8px;
        width: min(260px, calc(100% - 16px));
        padding: 10px 12px;
    }

    .fx-next-ep--hidden {
        transform: translateY(-10px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .fx-next-ep { transition: none; }
}
