/* ==========================================
   SalmasFlix — Sync Player · Up Next preview card
   Extracted from media.css in Phase 7.4.

   Triggered by `_startTimeUpdater` when the current video is in the
   last 15 seconds and a next queue item exists. Scoped entirely to
   `.media-up-next*` classes so extraction is zero-cascade-risk.

   Uses theme tokens for both buttons (Play now = var(--primary),
   Dismiss = var(--secondary)) so the card retints on every preset.
   In fullscreen (`.media-fs`) the card bumps to `z-index:25` to clear
   chat (z-20) + controls (z-20) and pads with safe-area-inset-* to
   clear the iPhone home indicator.
   ========================================== */

@layer features {


.media-up-next {
    position: absolute;
    right: 16px;
    bottom: 80px; /* clear the seekbar + transport row */
    z-index: 18;
    display: flex;
    gap: 12px;
    padding: 12px;
    max-width: 360px;
    background: rgba(15, 15, 30, 0.94);
    border: 1px solid rgba(var(--primary-rgb), 0.3);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55), 0 0 40px rgba(var(--primary-rgb), 0.08);
    backdrop-filter: blur(8px);
    animation: upNextIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
}
.media-up-next.hidden { display: none; }
/* In fullscreen the player fills the whole screen; bump z-index above chat
   overlay (20) and controls (20) so the Up Next card isn't hidden behind
   them when controls come into view. */
.media-fs .media-up-next {
    z-index: 25;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
}
.media-up-next-thumb {
    width: 80px; height: 48px;
    /* contain (not cover) so the full uploaded thumbnail fits into the card
       area without any edges being cropped. Mixed aspect ratios (movie
       posters, 16:9 YouTube, 4:3 oEmbed) all sit cleanly on the themed
       gradient. */
    object-fit: contain;
    object-position: center;
    border-radius: 6px;
    flex-shrink: 0;
    background: linear-gradient(135deg,
        rgba(var(--primary-rgb), 0.2),
        rgba(var(--secondary-rgb), 0.18));
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}
.media-up-next-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.media-up-next-label {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.media-up-next-title {
    color: #fff;
    font-size: 0.92rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.media-up-next-actions { display: flex; gap: 8px; margin-top: 4px; }
/* Dismiss = solid secondary with white text (user wanted "purple white
   text which is the websites theme secondary"). */
.media-up-next-btn {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: var(--secondary);
    color: #fff;
    transition: filter 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 2px 6px rgba(var(--secondary-rgb), 0.28);
}
.media-up-next-btn:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--secondary-rgb), 0.4);
}
/* Play now = solid primary with white text (user wanted "golden white
   text which is the websites theme primary"). */
.media-up-next-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.35);
}
.media-up-next-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.5);
    transform: translateY(-1px);
}
@keyframes upNextIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Mobile: stack the card at the bottom center + narrower */
/* breakpoint snap 600px -> 768px (Phase 7.6 ladder) */
@media (max-width: 768px) {
    .media-up-next {
        right: 8px; left: 8px; bottom: 70px;
        max-width: none;
    }
    .media-up-next-thumb { width: 72px; height: 44px; }
    .media-up-next-title { font-size: 0.85rem; }
}


} /* end @layer features */
