/* =============================================================
 * Session On-Demand Recordings (155)
 * Attendee-facing thumbnail grid + shared Bitmovin player slot
 * on /sp/session/{guid}. Loaded globally from App.razor.
 * ============================================================= */

.session-ondemand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

/* -------------------------------------------------------------
 * Video slot — reserves a 16:9 area whether the player is loaded
 * or we're showing a notice / idle placeholder. Matches the live
 * player's visual footprint so the page doesn't jump.
 * ------------------------------------------------------------- */
.session-ondemand__slot {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0b0b10;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.session-ondemand__player {
    width: 100%;
    height: 100%;
}

.session-ondemand__slot-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.35);
    font-size: 3rem;
}

.session-ondemand__notice {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(17, 17, 26, 0.92), rgba(31, 31, 46, 0.92));
    color: #fff;
    text-align: center;
}

.session-ondemand__notice > i {
    font-size: 2rem;
    opacity: 0.9;
}

.session-ondemand__notice-text {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    max-width: 32rem;
}

.session-ondemand__notice--entitlement {
    /* Slight tint toward community accent for the ticket-wall state. */
    background:
        linear-gradient(135deg, rgba(17, 17, 26, 0.9), rgba(31, 31, 46, 0.9)),
        radial-gradient(circle at 50% 40%, var(--community-accent, #818cf8) 0%, transparent 55%);
    background-blend-mode: multiply;
}

.session-ondemand__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.625rem 1rem;
    background: var(--community-primary, #4f46e5);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 999px;
    text-decoration: none;
    transition: background-color 150ms ease, transform 120ms ease;
}

.session-ondemand__cta:hover,
.session-ondemand__cta:focus-visible {
    background: color-mix(in srgb, var(--community-primary, #4f46e5) 80%, black 20%);
    outline: none;
    transform: translateY(-1px);
}

/* -------------------------------------------------------------
 * Section heading
 * ------------------------------------------------------------- */
.session-ondemand__heading {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
}

/* -------------------------------------------------------------
 * Thumbnail grid
 * ------------------------------------------------------------- */
.session-ondemand__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

/* -------------------------------------------------------------
 * Thumbnail card
 * ------------------------------------------------------------- */
.ondemand-thumb {
    display: flex;
}

.ondemand-thumb__button {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 44px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    overflow: hidden;
    padding: 0;
    cursor: pointer;
    text-align: left;
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 120ms ease;
}

.ondemand-thumb__button:hover,
.ondemand-thumb__button:focus-visible {
    border-color: var(--community-primary, #4f46e5);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    outline: none;
    transform: translateY(-1px);
}

.ondemand-thumb__button:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--community-primary, #4f46e5) 35%, transparent);
}

.ondemand-thumb--active .ondemand-thumb__button {
    border-color: var(--community-primary, #4f46e5);
    box-shadow: 0 0 0 2px var(--community-primary, #4f46e5);
}

/* Poster */
.ondemand-thumb__poster {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #e5e7eb;
    overflow: hidden;
}

.ondemand-thumb__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ondemand-thumb__poster-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 30% 30%, var(--community-accent, #818cf8) 0%, transparent 65%),
        linear-gradient(135deg, var(--community-primary, #4f46e5), color-mix(in srgb, var(--community-primary, #4f46e5) 60%, black 40%));
    background-blend-mode: overlay;
    color: rgba(255, 255, 255, 0.8);
    font-size: 2rem;
}

.ondemand-thumb__logo {
    max-width: 60%;
    max-height: 60%;
    object-fit: contain;
    opacity: 0.85;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.ondemand-thumb__duration {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    padding: 0.125rem 0.5rem;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
}

.ondemand-thumb__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2.25rem;
    opacity: 0;
    background: rgba(0, 0, 0, 0.25);
    transition: opacity 160ms ease;
    pointer-events: none;
}

.ondemand-thumb__button:hover .ondemand-thumb__play,
.ondemand-thumb__button:focus-visible .ondemand-thumb__play {
    opacity: 1;
}

/* Meta */
.ondemand-thumb__meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.625rem 0.75rem 0.75rem;
}

.ondemand-thumb__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    line-height: 1.3;
    word-break: break-word;
}

.ondemand-thumb__note {
    font-size: 0.75rem;
    color: var(--text-secondary, #4B5563);
    font-style: italic;
}

.ondemand-thumb__partial {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 0.0625rem 0.375rem;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    border-radius: 0.25rem;
}

/* -------------------------------------------------------------
 * Motion (respect prefers-reduced-motion — default is no animation)
 * ------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .ondemand-thumb__button,
    .session-ondemand__cta,
    .ondemand-thumb__play {
        transition: none;
    }
}
