/*
 * MixGeo flow:
 * "უყურე ახლა" -> PlayerJS VAST -> MixGeo iframe
 */

#mixgeo-vast-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#mixgeo-vast-modal.is-open {
    display: flex;
}

.mixgeo-vast-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.mixgeo-vast-dialog {
    position: relative;
    z-index: 2;
    width: min(1200px, 96vw);
    background: #000;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
    max-width: 900px;
}

.mixgeo-vast-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

#mixgeo-ad-stage,
#mixgeo-vast-player,
#mixgeo-movie-iframe,
#mixgeo-player-loading {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

#mixgeo-ad-stage {
    z-index: 20;
    background: #000;
}

#mixgeo-vast-player {
    background: #000;
}

#mixgeo-movie-iframe {
    z-index: 10;
    display: none;
    border: 0;
    background: #000;
}

#mixgeo-player-loading {
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: #000;
    font-size: 16px;
}

.mixgeo-vast-close {
    position: absolute;
    top: -44px;
    right: 0;
    z-index: 100;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 40px;
    line-height: 42px;
    cursor: pointer;
}

body.mixgeo-vast-open {
    overflow: hidden;
}

@media (max-width: 767px) {

    #mixgeo-vast-modal {
        padding: 8px;
    }

    .mixgeo-vast-dialog {
        width: 100%;
    }

    .mixgeo-vast-close {
        top: -40px;
    }
}


/* =====================================================
   TRAILER PLAYERJS MODAL
   ===================================================== */

#mixgeo-trailer-modal {
    position: fixed;
    inset: 0;
    z-index: 1000001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#mixgeo-trailer-modal.is-open {
    display: flex;
}

.mixgeo-trailer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}

.mixgeo-trailer-dialog {
    position: relative;
    z-index: 2;
    width: min(1000px, 96vw);
    max-width: 900px;
    background: #000;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
}

.mixgeo-trailer-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

#mixgeo-trailer-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.mixgeo-trailer-close {
    position: absolute;
    top: -44px;
    right: 0;
    z-index: 100;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 40px;
    line-height: 42px;
    cursor: pointer;
}

body.mixgeo-trailer-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    #mixgeo-trailer-modal {
        padding: 8px;
    }

    .mixgeo-trailer-dialog {
        width: 100%;
    }

    .mixgeo-trailer-close {
        top: -40px;
    }
}


/* Match native watch-button sizing; keep a distinct background. */
.movie-details-banner .mg-player-actions { flex-wrap: wrap; }
.movie-details-banner .mixgeo_watch_vast,
.movie-details-banner .mixgeo_trailer_btn { border: 0; cursor: pointer; }
.movie-details-banner .mg-player-actions .watchroom-open {
    border: 0;
    border-radius: 10px;
    background: linear-gradient(110deg, #176c65, #24579c);
    box-shadow: inset 0 0 0 1px #79e8c655;
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: filter .2s ease, box-shadow .2s ease;
}
.movie-details-banner .watchroom-open svg { width: 13px; height: 15px; flex-shrink: 0; color: #a6ffd4; }
.movie-details-banner .watchroom-open:hover { color: #fff; filter: brightness(1.15); box-shadow: inset 0 0 0 1px #a6ffd4; }
.movie-details-banner .watchroom-open:focus-visible { outline: 3px solid #a6ffd4; outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .movie-details-banner .watchroom-open { transition: none; } }
