/* ═══════════════════════════════════════════════════
   PLAYER PRO — Glass v3  (black · gray · green · orange)
   ═══════════════════════════════════════════════════ */

/* ── Modal shell ──────────────────────────────────── */
.player-modal-fullscreen {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 2000;
    flex-direction: column;
    overflow: hidden;
}
.player-modal-fullscreen.active { display: flex; }

/* ── Video container ──────────────────────────────── */
.player-video-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    flex-shrink: 0;
    overflow: hidden;
}
.player-video-container iframe {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    border: none;
    display: block;
}

/* ── Top overlay (no back btn — close only) ───────── */
.player-overlay-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 10px 14px;
    background: linear-gradient(180deg,
        rgba(0,0,0,.78) 0%,
        rgba(0,0,0,.15) 70%,
        transparent 100%);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    z-index: 30;
    pointer-events: none;
}
.player-overlay-top > * { pointer-events: auto; }

/* Hide the back button entirely */
.player-back-btn { display: none !important; }

.player-close-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    color: rgba(255,255,255,.85);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: background .15s, transform .12s;
    flex-shrink: 0;
    margin-left: auto;
}
.player-close-btn:active { background: rgba(255,80,40,.6); transform: scale(.9); }

.player-title-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: 68%;
    pointer-events: none;
}

.player-live-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #ff6a00, #ee4d2a);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #fff;
    box-shadow: 0 2px 10px rgba(255,106,0,.45);
}
.live-dot {
    width: 5px; height: 5px;
    background: #fff;
    border-radius: 50%;
    animation: livePulse 1.4s ease-in-out infinite;
}
@keyframes livePulse {
    0%,100% { opacity:1; transform:scale(1); }
    50%      { opacity:.3; transform:scale(1.5); }
}
.player-title {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    margin: 0;
    text-shadow: 0 1px 8px rgba(0,0,0,.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ── OLD bottom controls — hidden ─────────────────── */
.player-overlay-controls { display: none !important; }

/* ══════════════════════════════════════════════════
   GLASS PANEL
   ══════════════════════════════════════════════════ */
.pgl-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0c0c10;
    border-top: 1px solid rgba(255,255,255,.07);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.pgl-panel::-webkit-scrollbar { width: 0; }

/* ══════════════════════════════════════════════════
   SERVER SELECTOR
   ══════════════════════════════════════════════════ */
.pgl-servers {
    padding: 16px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
    background: rgba(255,255,255,.025);
}

.pgl-servers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 13px;
}

.pgl-srv-label-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.pgl-srv-pulse {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #39e09b;
    box-shadow: 0 0 0 0 rgba(57,224,155,.7);
    animation: srvPulse 2s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes srvPulse {
    0%   { box-shadow: 0 0 0 0   rgba(57,224,155,.7); }
    60%  { box-shadow: 0 0 0 8px rgba(57,224,155,0); }
    100% { box-shadow: 0 0 0 0   rgba(57,224,155,0); }
}
.pgl-srv-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: rgba(255,255,255,.85);
}
.pgl-srv-count {
    font-size: 11px;
    font-weight: 600;
    color: #39e09b;
    background: rgba(57,224,155,.1);
    border: 1px solid rgba(57,224,155,.22);
    padding: 3px 10px;
    border-radius: 20px;
}

/* Scrollable row */
.pgl-servers-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 3px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    will-change: scroll-position;
    contain: layout style;
}
.pgl-servers-scroll::-webkit-scrollbar { display: none; }

/* Empty state */
.pgl-srv-empty {
    display: flex;
    align-items: center;
    gap: 9px;
    color: rgba(255,255,255,.28);
    font-size: 12px;
    padding: 4px 0;
}
.pgl-srv-empty i { font-size: 14px; }

/* ── Server pill ──────────────────────────────────── */
.pgl-srv-pill {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 14px 9px 10px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 50px;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .1s;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 155px;
    position: relative;
    overflow: hidden;
    will-change: transform;
}
/* glass sheen */
.pgl-srv-pill::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,.06), transparent);
    border-radius: 50px 50px 0 0;
    pointer-events: none;
}
.pgl-srv-pill:active { transform: scale(.94); }

/* active — orange glow */
.pgl-srv-pill.active {
    background: rgba(255,106,0,.15);
    border-color: rgba(255,106,0,.45);
    box-shadow: 0 0 18px rgba(255,106,0,.2),
                inset 0 1px 0 rgba(255,255,255,.08);
}

/* Number circle */
.pgl-pill-num {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: rgba(255,255,255,.55);
    flex-shrink: 0;
    transition: background .18s, color .18s, border-color .18s;
}
.pgl-srv-pill.active .pgl-pill-num {
    background: #ff6a00;
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 12px rgba(255,106,0,.55);
}

/* Channel name */
.pgl-pill-name {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,.6);
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    transition: color .18s;
}
.pgl-srv-pill.active .pgl-pill-name { color: #fff; }

/* HD badge */
.pgl-pill-hd {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .4px;
    color: #39e09b;
    background: rgba(57,224,155,.12);
    border: 1px solid rgba(57,224,155,.28);
    padding: 2px 6px;
    border-radius: 5px;
    flex-shrink: 0;
}

/* Ping badge */
.pgl-pill-ping {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 5px;
    flex-shrink: 0;
}
.pgl-pill-ping.fast   { color: #39e09b; background: rgba(57,224,155,.12); }
.pgl-pill-ping.medium { color: #f5b942; background: rgba(245,185,66,.12); }
.pgl-pill-ping.slow   { color: #ff5c5c; background: rgba(255,92,92,.12);  }

/* ══════════════════════════════════════════════════
   ACTION BUTTONS — 3 cols
   ══════════════════════════════════════════════════ */
.pgl-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 16px 16px 14px;
    flex-shrink: 0;
}

.pgl-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 8px 13px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 18px;
    cursor: pointer;
    transition: background .15s, transform .1s;
    position: relative;
    overflow: hidden;
}
/* top sheen */
.pgl-btn::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 45%;
    background: linear-gradient(180deg, rgba(255,255,255,.06), transparent);
    border-radius: 18px 18px 0 0;
    pointer-events: none;
}
.pgl-btn:active {
    transform: scale(.92);
    background: rgba(255,255,255,.09);
}

.pgl-btn-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    transition: transform .13s;
    position: relative;
    z-index: 1;
}
.pgl-btn:active .pgl-btn-icon { transform: scale(.87); }

.pgl-btn span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: rgba(255,255,255,.45);
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Recargar — orange */
.pgl-btn-reload .pgl-btn-icon {
    background: rgba(255,106,0,.14);
    color: #ff6a00;
    border: 1px solid rgba(255,106,0,.22);
    box-shadow: 0 0 12px rgba(255,106,0,.15);
}
.pgl-btn-reload:active { border-color: rgba(255,106,0,.35); }

/* Compartir — gray-blue glass */
.pgl-btn-share .pgl-btn-icon {
    background: rgba(120,140,180,.14);
    color: #8aadff;
    border: 1px solid rgba(120,140,180,.2);
    box-shadow: 0 0 12px rgba(120,140,180,.12);
}
.pgl-btn-share:active { border-color: rgba(120,140,180,.35); }

/* Pantalla — green */
.pgl-btn-fs .pgl-btn-icon {
    background: rgba(57,224,155,.13);
    color: #39e09b;
    border: 1px solid rgba(57,224,155,.22);
    box-shadow: 0 0 12px rgba(57,224,155,.15);
}
.pgl-btn-fs:active { border-color: rgba(57,224,155,.38); }

/* ══════════════════════════════════════════════════
   STREAM PLAY OVERLAY
   ══════════════════════════════════════════════════ */
.stream-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.80);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    z-index: 50;
    cursor: pointer;
    transition: opacity .22s;
}
.stream-play-overlay.hidden { opacity: 0; pointer-events: none; }

.stream-play-btn {
    width: 68px; height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6a00, #ff9340);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 0 rgba(255,106,0,.6);
    animation: playPulse 2.2s ease-in-out infinite;
}
.stream-play-btn i { font-size: 24px; color: #fff; margin-left: 4px; }
.stream-play-overlay:active .stream-play-btn { transform: scale(.88); }

@keyframes playPulse {
    0%   { box-shadow: 0 0 0 0   rgba(255,106,0,.6); }
    55%  { box-shadow: 0 0 0 22px rgba(255,106,0,0); }
    100% { box-shadow: 0 0 0 0   rgba(255,106,0,0); }
}
.stream-play-label {
    color: rgba(255,255,255,.7);
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    letter-spacing: .2px;
}

/* ══════════════════════════════════════════════════
   LOADING SPINNER
   ══════════════════════════════════════════════════ */
.player-video-container .loading-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.55);
    z-index: 20;
}
.spinner {
    width: 44px; height: 44px;
    border: 3px solid rgba(255,255,255,.08);
    border-top-color: #ff6a00;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════
   PANEL ENTRANCE ANIMATION
   ══════════════════════════════════════════════════ */
@keyframes pglSlideUp {
    from { opacity:0; transform:translateY(10px); }
    to   { opacity:1; transform:translateY(0); }
}
.player-modal-fullscreen.active .pgl-panel {
    animation: pglSlideUp .28s ease both;
}
