/* ================================================================
   GLOBALINK — GlobalFilm Custom HTML5 Player (gf-player)
   Añadir al final de style.css
   ================================================================ */

/* ── Contenedor del player ── */
.gf-player-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    /* Mostrar controles al hover del contenedor */
    cursor: pointer;
}

/* ── Overlay de play/pause central ── */
.gf-cp-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 10;
}
.gf-cp-overlay--visible {
    opacity: 1;
    pointer-events: auto;
}
.gf-cp-bigplay {
    width: clamp(52px, 8vw, 72px);
    height: clamp(52px, 8vw, 72px);
    border-radius: 50%;
    background: rgba(198,57,184,.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(20px, 3vw, 28px);
    color: #fff;
    cursor: pointer;
    transition: transform .2s, background .2s;
    box-shadow: 0 4px 24px rgba(198,57,184,.5), inset 0 1px 1px rgba(255,255,255,.25);
}
.gf-cp-bigplay:hover {
    transform: scale(1.12);
    background: rgba(198,57,184,1);
}

/* ── Spinner de carga ── */
.gf-cp-spinner {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.4);
    z-index: 15;
    pointer-events: none;
}
.gf-cp-spin-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(198,57,184,.3);
    border-top-color: #c639b8;
    border-radius: 50%;
    animation: gfSpin .8s linear infinite;
}

/* ── Barra de controles inferior (glassmorphic) ── */
.gf-cp-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 0 12px 12px;
    background: linear-gradient(to top, rgba(0,0,0,.85) 0%, transparent 100%);
    backdrop-filter: blur(0px);      /* no blur en el degradado */
    transform: translateY(100%);     /* oculta por defecto */
    transition: transform .28s ease;
    pointer-events: none;
}
.gf-cp-controls.visible {
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Barra de progreso ── */
.gf-cp-progress-wrap {
    position: relative;
    height: 18px;          /* área táctil mayor que la barra visual */
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 6px;
}
.gf-cp-progress-bg {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 4px;
    overflow: hidden;
}
.gf-cp-buffered {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: rgba(255,255,255,.25);
    border-radius: 4px;
    transition: width .3s linear;
}
.gf-cp-played {
    position: absolute;
    top: 0; left: 0;
    height: 100%;
    background: linear-gradient(90deg, #c639b8, #1e8ee9);
    border-radius: 4px;
    transition: width .1s linear;
}
.gf-cp-thumb {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px rgba(198,57,184,.7);
    pointer-events: none;
    opacity: 0;
    transition: opacity .2s;
    left: 0%;
}
.gf-cp-progress-wrap:hover .gf-cp-thumb { opacity: 1; }
.gf-cp-progress-wrap:hover .gf-cp-progress-bg { height: 6px; }

/* ── Fila de botones ── */
.gf-cp-btn-row {
    display: flex;
    align-items: center;
    gap: 4px;
}
.gf-cp-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,.85);
    font-size: 16px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 8px;
    transition: color .15s, background .15s;
    line-height: 1;
    position: relative;
    flex-shrink: 0;
}
.gf-cp-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.gf-cp-btn .gf-cp-skip-lbl {
    font-size: 9px;
    position: absolute;
    bottom: 3px; left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,.7);
    font-weight: 700;
}
.gf-cp-time {
    font-size: 11px;
    color: rgba(255,255,255,.75);
    white-space: nowrap;
    padding: 0 4px;
    font-family: 'Outfit', sans-serif;
}

/* ── Slider de volumen ── */
.gf-cp-vol-slider {
    width: 70px;
    height: 3px;
    cursor: pointer;
    accent-color: #c639b8;
    border-radius: 4px;
    background: rgba(255,255,255,.2);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
}
@media (max-width: 480px) {
    .gf-cp-vol-slider { display: none; }
}

/* ── Menú de configuración (velocidad + subtítulos) ── */
.gf-cp-settings-menu {
    position: absolute;
    bottom: 72px;
    right: 12px;
    width: 200px;
    background: rgba(10,10,22,.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(198,57,184,.25);
    border-radius: 16px;
    padding: 12px;
    z-index: 30;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 8px 36px rgba(0,0,0,.7), inset 0 1px 0 rgba(255,255,255,.07);
    animation: gfFadeIn .18s ease;
}
.gf-cp-sm-title {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,.5);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.gf-cp-sm-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.gf-cp-sm-label {
    font-size: 11px;
    color: rgba(255,255,255,.45);
    margin: 6px 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.gf-cp-sm-item {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    color: rgba(255,255,255,.75);
    font-size: 12px;
    font-family: 'Outfit', sans-serif;
    padding: 6px 10px;
    cursor: pointer;
    text-align: left;
    transition: background .15s, border-color .15s, color .15s;
}
.gf-cp-sm-item:hover {
    background: rgba(198,57,184,.18);
    border-color: rgba(198,57,184,.4);
    color: #fff;
}
.gf-cp-sm-item.active {
    background: linear-gradient(135deg, rgba(106,31,168,.6), rgba(198,57,184,.5));
    border-color: rgba(198,57,184,.6);
    color: #fff;
    font-weight: 700;
}

/* ── Subtítulos nativos: estilizar los cue captions ── */
video::cue {
    background: rgba(0,0,0,.78);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.1em;
    border-radius: 4px;
    padding: 2px 8px;
}

/* ── Fullscreen: ocultar UI de GF, mostrar solo el player ── */
.gf-player-wrap:fullscreen .gf-cp-controls,
.gf-player-wrap:-webkit-full-screen .gf-cp-controls {
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Responsive: en pantallas muy pequeñas reducir iconos ── */
@media (max-width: 360px) {
    .gf-cp-btn { font-size: 13px; padding: 4px 5px; }
    .gf-cp-time { font-size: 10px; }
}

/* 2. Contenedor principal con scroll compatible móvil */
#gf-portal {

    min-height: 100vh;

    overflow-y: auto;

    -webkit-overflow-scrolling: touch;
}

/* Permite scroll y toques en contenedores específicos */
.gf-scrollable {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    height: 100%;
    width: 100%;
}

.movie-card, .btn-play, .chat-send-btn {
    pointer-events: auto !important; 
    touch-action: manipulation; /* Optimiza el tiempo de respuesta del tap */
}

/* Ejemplo para que tus secciones internas ocupen el espacio disponible */
.gf-view-container { 
    flex: 1;           /* Esto hace que el elemento crezca para llenar el portal */
    overflow-y: auto;  /* Si la sección en sí misma debe tener scroll interno */
    width: 100%;
}

/* =========================================================
   FIX MOBILE — RESEÑAS / MODALES / TECLADO
========================================================= */

.gf-review-modal,
.gf-review-box,
.gf-review-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.gf-review-form textarea,
.gf-review-box textarea {

    width: 100% !important;
    max-width: 100% !important;

    min-height: 120px;

    resize: vertical;

    box-sizing: border-box;

    padding: 12px;

    font-size: 16px;

    border-radius: 12px;

    overflow-y: auto;
}

/* FIX ESPECIAL MOBILE */
@media (max-width: 768px) {
    #gf-portal {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: #050508 !important;
        z-index: 999999 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        /* NO display:block — el JS gestiona display:flex/none según el estado */
    }
}

    .gf-review-modal,
    .gf-review-box {

        width: 100vw !important;
        max-width: 100vw !important;

        padding: 12px;

        left: 0;
        right: 0;

        border-radius: 0;

        overflow-y: auto;

        max-height: 90vh;
    }

    .gf-review-form textarea,
    .gf-review-box textarea {

        width: 100% !important;

        min-height: 140px;

        font-size: 16px;
    }

/* VIDEO REMOTO PAREJA */

.gf-remote-video {

    position: absolute;

    width: 140px;
    height: 220px;

    right: 16px;
    bottom: 90px;

    background: #000;

    border-radius: 16px;

    object-fit: cover;

    z-index: 50;

    border: 2px solid rgba(255,255,255,.15);

    box-shadow: 0 6px 24px rgba(0,0,0,.45);
}

@media (max-width:768px) {

    .gf-remote-video {

        width: 110px;
        height: 170px;

        right: 10px;
        bottom: 80px;
    }
}
/* ================================================================
   GLOBALFILM — Nuevos estilos v2.0
   Watch Party PIN + WebRTC Grid + Controles Mic/Cam
   ================================================================ */

/* ── Grid de video WebRTC — lado a lado responsive ── */
#gf-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 6px;
    width: 100%;
    padding: 4px;
}
#gf-video-grid > div {
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    min-height: 90px;
    position: relative;
}
#gf-video-grid video {
    width: 100%;
    display: block;
    object-fit: cover;
    min-height: 90px;
    max-height: 180px;
    background: #000;
    border-radius: 10px;
}
@media (max-width: 480px) {
    #gf-video-grid {
        grid-template-columns: 1fr 1fr;
        gap: 4px;
    }
    #gf-video-grid video { max-height: 120px; min-height: 70px; }
}

/* ── Botones de control mic/cam sobre el video local ── */
#gf-btn-mic, #gf-btn-cam {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background .2s, transform .1s;
    touch-action: manipulation;
}
#gf-btn-mic:active, #gf-btn-cam:active { transform: scale(.9); }
#gf-btn-mic.muted, #gf-btn-cam.hidden-cam {
    background: rgba(198,57,184,.75);
}

/* ── Modal PIN — z-index seguro, no bloquea scroll ── */
#gf-pin-modal, #gf-pin-input-modal {
    position: fixed;
    inset: 0;
    z-index: 9999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    /* No usar overflow:hidden aquí — rompe scroll en iOS */
}
#gf-pin-input {
    -webkit-appearance: none;
    appearance: none;
    caret-color: #c639b8;
    /* Agrandar área táctil en móvil */
    min-height: 52px;
}
#gf-pin-input:focus {
    border-color: rgba(198,57,184,.8) !important;
    box-shadow: 0 0 0 3px rgba(198,57,184,.2);
    outline: none;
}

/* ── Overlay de espera del invitado ── */
#gf-waiting-overlay {
    position: absolute;
    inset: 0;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(5,5,14,.92);
    border-radius: inherit;
}

/* ── Video desactivado (cámara off) ── */
#gf-rv-local[data-cam-off="true"] {
    opacity: 0.15;
    filter: grayscale(1);
}

/* ── Spinner animación (reutilizada) ── */
@keyframes gfSpin {
    to { transform: rotate(360deg); }
}

/* ── Peer connection estado ── */
.gf-peer-disconnected {
    opacity: 0.4;
    filter: grayscale(0.5);
    transition: opacity .3s;
}
.gf-peer-connected {
    opacity: 1;
    transition: opacity .3s;
}
