/* Page After : replays (Jour > Conférence) */

.replay-page {
    box-sizing: border-box;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    color: var(--color-text, #1F2937);
    font-family: inherit;

    /* Accent des éléments actifs (onglet, conférence, drapeau) : doré du bandeau */
    --replay-accent: #F2C94C;
    --replay-accent-text: #1B2A5C;
}

.replay-page *,
.replay-page *::before,
.replay-page *::after {
    box-sizing: border-box;
}

/* ---------- Disposition : 2/3 lecteur - 1/3 menu ---------- */

.replay-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

/* ---------- Lecteur ---------- */

.replay-player-section {
    position: relative;
    scroll-margin-top: 1rem;
}

.replay-player-frame {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.replay-iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
}

.replay-unavailable {
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #fff;
    text-align: center;
}

.replay-title {
    margin: 1rem 0 0;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1.3;
}

/* ---------- Drapeaux de langue (repris du live) ---------- */

.language-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.language-flag {
    padding: 0;
    line-height: 0;
    background: none;
    border: 2px solid transparent;
    border-radius: 0.375rem;
    cursor: pointer;
    opacity: 0.55;
    transition: opacity 0.2s, transform 0.2s, border-color 0.2s;
}

.language-flag:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.language-flag.active {
    opacity: 1;
    border-color: var(--replay-accent);
}

.language-flag img {
    display: block;
    width: 36px;
    height: 24px;
    object-fit: cover;
    border-radius: 0.25rem;
}

.language-flag span {
    display: inline-block;
    min-width: 36px;
    padding: 0 0.4rem;
    line-height: 24px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ---------- Menu des conférences ---------- */
/* Encart « verre » translucide : se fond dans le fond du design global */

.replay-sidebar {
    display: flex;
    flex-direction: column;
    height: var(--replay-player-height, auto);
    margin-top: var(--replay-player-offset, 0);
    min-height: 0;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.replay-days {
    flex: 0 0 auto;
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    overflow-x: auto;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.replay-day {
    flex: 1 0 auto;
    padding: 0.6rem 0.75rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    border: 0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.replay-day:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.replay-day.active {
    background: var(--replay-accent);
    color: var(--replay-accent-text);
}

.replay-conferences {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 0.5rem;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.replay-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem;
    text-align: left;
    background: transparent;
    color: rgba(255, 255, 255, 0.85);
    font: inherit;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.replay-item + .replay-item {
    margin-top: 0.25rem;
}

.replay-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.replay-item.active {
    background: rgba(255, 255, 255, 0.14);
    border-left-color: var(--replay-accent);
    color: #fff;
}

.replay-item-icon {
    flex: 0 0 auto;
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 0.1rem;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.85);
    border: 2px solid currentColor;
    border-radius: 50%;
}

.replay-item.active .replay-item-icon {
    background: var(--replay-accent);
    border-color: var(--replay-accent);
    color: var(--replay-accent-text);
}

.replay-item-title {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    line-height: 1.35;
}

.replay-item-langs {
    flex: 0 0 auto;
    display: flex;
    gap: 0.2rem;
}

.replay-item-langs img {
    width: 18px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
}

.replay-item-langs span {
    font-size: 0.65rem;
    font-weight: 700;
}

.replay-item.is-soon {
    cursor: default;
    color: rgba(255, 255, 255, 0.5);
}

.replay-item.is-soon:hover {
    background: transparent;
}

.replay-item.is-soon .replay-item-icon {
    opacity: 0.5;
}

.replay-item-soon {
    flex: 0 0 auto;
    padding: 0.15rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--replay-accent);
    border: 1px solid var(--replay-accent);
    border-radius: 999px;
}

/* ---------- Aucun replay ---------- */

.replay-empty {
    max-width: 640px;
    margin: 3rem auto;
    padding: 3rem 1.5rem;
    background: #fff;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.replay-empty h1 {
    margin: 0 0 0.75rem;
}

.replay-empty p {
    margin: 0;
    opacity: 0.75;
}

/* ---------- Écran étroit : menu sous le lecteur ---------- */

@media (max-width: 900px) {
    .replay-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .replay-sidebar {
        height: auto;
        margin-top: 0;
    }
}

@media (max-width: 640px) {
    .replay-page {
        padding-top: 1.25rem;
    }

    .replay-title {
        font-size: 1.25rem;
    }

    .language-flag img {
        width: 30px;
        height: 20px;
    }
}
