/* ===========================================
   Replay Page - Netflix Style
   Inherits from _hero.css for standard hero structure
   =========================================== */

/* ===========================================
   Replay-Specific Hero Styles
   =========================================== */

/* Title Accent Colors */
.replay-hero__title-accent {
    color: var(--color-accent);
}

.replay-hero__title-edition {
    color: var(--color-text-primary);
}

/* Title size for replay page (desktop) */
/* Title size for replay page */
.hero--replay .hero__title {
    font-size: 3rem;
    /* Desktop size - Balanced & Impactful */
    line-height: 1;
    margin-bottom: var(--spacing-sm);
}

@media (max-width: 768px) {
    .hero--replay .hero__title {
        font-size: 2.5rem;
        /* Mobile size - Readable but impactful */
        line-height: 1.1;
        margin-bottom: var(--spacing-xs);
    }
}

/* ===========================================
   Edition Selector Dropdown - Netflix Style
   =========================================== */

.replay-hero__selector {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.replay-hero__dropdown {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
}

.replay-hero__dropdown:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.replay-hero__dropdown[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--color-accent);
}

.replay-hero__dropdown-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.replay-hero__dropdown-value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    letter-spacing: 0.05em;
}

.replay-hero__dropdown-arrow {
    width: 20px;
    height: 20px;
    opacity: 0.7;
    transition: transform var(--transition-base);
}

.replay-hero__dropdown[aria-expanded="true"] .replay-hero__dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.replay-hero__dropdown-menu {
    position: absolute;
    top: calc(100% + var(--spacing-sm));
    left: 0;
    min-width: 280px;
    background: rgba(20, 20, 20, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-base);
    z-index: 100;
    overflow: hidden;
}

.replay-hero__dropdown-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.replay-hero__dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    width: 100%;
    padding: var(--spacing-md) var(--spacing-lg);
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.replay-hero__dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.replay-hero__dropdown-item[data-active="true"] {
    background: rgba(229, 9, 20, 0.15);
}

.replay-hero__dropdown-item-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 0.03em;
}

.replay-hero__dropdown-item-subtitle {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-left: auto;
}

.replay-hero__dropdown-check {
    width: 18px;
    height: 18px;
    color: var(--color-accent);
    flex-shrink: 0;
}

/* ===========================================
   Replay-Specific Overrides
   =========================================== */

/* Play button - uses standard hero__btn--primary red style from _hero.css */

/* Description - inherits from hero__description */
.replay-hero__description strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

/* ===========================================
   Episodes Section - Combats List
   =========================================== */

.episodes {
    background: var(--color-bg-primary);
    padding: var(--spacing-2xl) 0 var(--spacing-3xl);
}

.episodes__container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-xl);
}

.episodes__title {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: var(--color-text-primary);
    letter-spacing: 0.02em;
    margin-bottom: var(--spacing-xl);
}

.episodes__list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    transition: opacity 0.2s ease;
}

/* Episode Card */
.episode {
    display: flex;
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-base);
}

.episode:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(8px);
}

.episode--main {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.15), rgba(255, 107, 0, 0.1));
    border: 1px solid rgba(229, 9, 20, 0.3);
}

.episode--main:hover {
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.25), rgba(255, 107, 0, 0.15));
}

/* Episode Thumbnail */
.episode__thumbnail {
    position: relative;
    flex-shrink: 0;
    width: 180px;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.episode__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    opacity: 0;
    transition: all var(--transition-base);
}

.episode:hover .episode__play {
    opacity: 1;
}

.episode__play svg {
    width: 20px;
    height: 20px;
    color: white;
    margin-left: 3px;
}

/* Episode Info */
.episode__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.episode__header {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.episode__number {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.episode__title-text {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--color-text-primary);
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.episode__meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.episode__duration {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.episode__badge {
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-secondary);
}

.episode__badge--special {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 165, 0, 0.2));
    color: #ffd700;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.episode__badge--main {
    background: linear-gradient(135deg, var(--color-accent), var(--color-orange));
    color: white;
}

.episode__description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===========================================
   Responsive - Mobile
   =========================================== */

@media (max-width: 768px) {

    /* Ensure hero--replay has correct structure for mobile */
    .hero--replay .hero__slide {
        position: relative;
        display: flex;
        flex-direction: column;
    }

    .hero--replay .hero__slide--active {
        display: flex;
    }

    /* Video container 16:9 */
    .hero--replay .hero__video-container {
        position: relative;
        width: 100%;
        aspect-ratio: 16 / 9;
        height: auto;
    }

    /* Content below video */
    .hero--replay .hero__content {
        position: relative;
        padding: var(--spacing-md);
        padding-top: var(--spacing-xl);
        background: var(--color-bg-primary);
        z-index: 10;
        display: block;
    }

    .hero--replay .hero__info {
        position: relative;
        max-width: 100%;
    }

    /* Title floats up into video zone - CRITICAL */
    /* Uses high specificity to override _hero.css generic styles */
    /* Title positioning for mobile video overlay */
    section#hero.hero.hero--replay .hero__title {
        position: absolute;
        bottom: calc(100% + var(--spacing-sm));
        left: 0;
        margin: 0;
        white-space: nowrap;
        text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.9);
        z-index: 15;
    }

    /* Replay button positioned next to title in video zone */
    .hero--replay .hero__replay {
        position: absolute;
        bottom: auto;
        top: calc(56.25vw - 60px);
        right: var(--spacing-md);
        width: 40px;
        height: 40px;
        z-index: 20;
    }

    .hero--replay .hero__replay svg {
        width: 20px;
        height: 20px;
    }

    /* Dropdown adjustments */
    .replay-hero__dropdown {
        padding: var(--spacing-xs) var(--spacing-md);
    }

    .replay-hero__dropdown-value {
        font-size: 1.2rem;
    }

    /* Episodes */
    .episodes__container {
        padding: 0 var(--spacing-md);
    }

    .episode {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .episode__thumbnail {
        width: 100%;
    }

    .episode__title-text {
        white-space: normal;
        font-size: 1.1rem;
    }

    .episode__description {
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }
}

@media (max-width: 480px) {

    /* Title size for small mobile - high specificity */
    section#hero.hero.hero--replay .hero__title {
        font-size: 1.8rem;
        left: 0;
    }

    .replay-hero__dropdown-label {
        display: none;
    }

    .episode__header {
        flex-direction: column;
        gap: 2px;
    }

    .episode__number {
        font-size: 0.75rem;
    }
}

/* ===========================================
   Video Modal - Netflix Style
   =========================================== */
/* ===========================================
   Video Modal - Simple & Universal
   =========================================== */

.video-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.active {
    opacity: 1;
    visibility: visible;
}

.video-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
}

.video-modal__container {
    position: relative;
    width: calc(100% - 40px);
    max-width: 900px;
    background: #181818;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.video-modal.active .video-modal__container {
    transform: scale(1);
}

.video-modal__close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
}

.video-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.video-modal__close svg {
    width: 20px;
    height: 20px;
}

.video-modal__content {
    display: block;
}

.video-modal__player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 ratio */
    background: #000;
}

.video-modal__player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.video-modal__info {
    padding: 16px 20px;
    background: #181818;
}

.video-modal__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    color: #fff;
    margin: 0 0 4px 0;
}

.video-modal__meta {
    font-size: 0.875rem;
    color: #999;
    margin: 0;
}

/* ===========================================
   Next Video Overlay
   =========================================== */

.video-modal__next-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 15;
}

.video-modal__next-overlay.active {
    opacity: 1;
    visibility: visible;
}

.video-modal__next-content {
    text-align: center;
    padding: 24px;
    max-width: 400px;
}

.video-modal__next-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.video-modal__next-label {
    font-size: 1rem;
    color: #aaa;
}

.video-modal__next-countdown {
    font-family: var(--font-display);
    font-size: 2.5rem;
    color: #fff;
    line-height: 1;
}

.video-modal__next-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-align: left;
}

.video-modal__next-thumb {
    width: 120px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
}

.video-modal__next-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.video-modal__next-episode {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.video-modal__next-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-modal__next-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.video-modal__next-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.video-modal__next-btn svg {
    width: 16px;
    height: 16px;
}

.video-modal__next-btn--play {
    background: #fff;
    color: #000;
}

.video-modal__next-btn--play:hover {
    background: #e50914;
    color: #fff;
}

.video-modal__next-btn--cancel {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.video-modal__next-btn--cancel:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===========================================
   Responsive - Mobile
   =========================================== */

@media (max-width: 640px) {
    .video-modal__container {
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .video-modal__content {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .video-modal__player {
        flex-shrink: 0;
    }

    .video-modal__info {
        flex: 1;
        padding: 12px 16px;
    }

    .video-modal__title {
        font-size: 1.1rem;
    }

    .video-modal__close {
        top: 8px;
        right: 8px;
    }

    .video-modal__next-preview {
        flex-direction: column;
        text-align: center;
    }

    .video-modal__next-thumb {
        width: 100%;
        max-width: 160px;
    }

    .video-modal__next-title {
        white-space: normal;
    }

    .video-modal__next-actions {
        flex-direction: column;
    }

    .video-modal__next-btn {
        width: 100%;
    }
}