/* pawaHLS Player — Public Player Styles
   ============================================================ */

:root {
    --pawa-accent:   #e63946;
    --pawa-accent2:  #ff6b6b;
    --pawa-bg:       #0a0a12;
    --pawa-surface:  #111120;
    --pawa-bar:      #15151f;
    --pawa-border:   rgba(255,255,255,.08);
    --pawa-text:     #e8e8f0;
    --pawa-muted:    #666680;
    --pawa-success:  #2ec4b6;
    --pawa-radius:   12px;
}

/* ── Wrapper ─────────────────────────────────────────────────── */
.pawahlsplay-wrapper {
    position: relative;
    width: 100%;
    background: var(--pawa-bg);
    border-radius: var(--pawa-radius);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.5), 0 0 0 1px var(--pawa-border);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Title bar ───────────────────────────────────────────────── */
.pawahlsplay-title-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--pawa-surface);
    border-bottom: 1px solid var(--pawa-border);
    font-size: 13px;
    font-weight: 700;
    color: var(--pawa-text);
    letter-spacing: .3px;
}

.pawahlsplay-live-dot {
    width: 8px;
    height: 8px;
    background: var(--pawa-accent);
    border-radius: 50%;
    flex-shrink: 0;
    animation: pawahlsplay-pulse 1.6s ease-in-out infinite;
}
@keyframes pawahlsplay-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: .4; transform: scale(.7); }
}

/* ── Video wrap ──────────────────────────────────────────────── */
.pawahlsplay-video-wrap {
    position: relative;
    width: 100%;
    background: #000;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.pawahlsplay-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
}

/* ── Spinner ─────────────────────────────────────────────────── */
.pawahlsplay-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.45);
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s;
    z-index: 10;
}
.pawahlsplay-spinner.visible { opacity: 1; }
.pawahlsplay-spinner.loading { opacity: 1; } /* état initial jusqu'au premier canplay */
.pawahlsplay-spinner svg {
    width: 54px;
    height: 54px;
    animation: pawahlsplay-spin 1s linear infinite;
}
.pawahlsplay-spinner circle {
    stroke: var(--pawa-accent);
    stroke-linecap: round;
    stroke-dasharray: 80, 125;
    animation: pawahlsplay-dash 1.5s ease-in-out infinite;
}
@keyframes pawahlsplay-spin { to { transform: rotate(360deg); } }
@keyframes pawahlsplay-dash {
    0%   { stroke-dasharray: 1, 200; stroke-dashoffset: 0; }
    50%  { stroke-dasharray: 89, 200; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 89, 200; stroke-dashoffset: -124; }
}

/* ── Error overlay ───────────────────────────────────────────── */
.pawahlsplay-error-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.8);
    gap: 10px;
    z-index: 20;
}
.pawahlsplay-error-icon { font-size: 36px; }
.pawahlsplay-error-msg  { color: var(--pawa-text); font-size: 15px; margin: 0; }
.pawahlsplay-retry-btn {
    background: var(--pawa-accent);
    color: #fff;
    border: none;
    padding: 9px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 4px;
    transition: background .2s, transform .15s;
}
.pawahlsplay-retry-btn:hover { background: #c1121f; transform: scale(1.04); }

/* ── Controls bar ────────────────────────────────────────────── */
.pawahlsplay-controls-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
    background: var(--pawa-bar);
    border-top: 1px solid var(--pawa-border);
}

/* ── Quality section ─────────────────────────────────────────── */
.pawahlsplay-quality-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pawahlsplay-quality-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--pawa-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.pawahlsplay-quality-btns {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pawahlsplay-loading-quality {
    font-size: 12px;
    color: var(--pawa-muted);
    font-style: italic;
}

/* Quality buttons — injected by JS */
.pawahlsplay-q-btn {
    position: relative;
    background: rgba(255,255,255,.07);
    color: var(--pawa-text);
    border: 1px solid rgba(255,255,255,.12);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s, transform .15s;
    white-space: nowrap;
    font-family: inherit;
    letter-spacing: .3px;
}
.pawahlsplay-q-btn:hover {
    background: rgba(230,57,70,.2);
    border-color: rgba(230,57,70,.4);
    color: #fff;
    transform: translateY(-1px);
}
.pawahlsplay-q-btn.active {
    background: var(--pawa-accent);
    border-color: var(--pawa-accent);
    color: #fff;
    box-shadow: 0 0 10px rgba(230,57,70,.4);
}
.pawahlsplay-q-btn.auto-btn {
    background: rgba(46,196,182,.12);
    border-color: rgba(46,196,182,.3);
    color: var(--pawa-success);
}
.pawahlsplay-q-btn.auto-btn.active {
    background: var(--pawa-success);
    border-color: var(--pawa-success);
    color: #fff;
    box-shadow: 0 0 10px rgba(46,196,182,.4);
}

/* ── Meta info (bandwidth, resolution) ──────────────────────── */
.pawahlsplay-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pawahlsplay-bandwidth,
.pawahlsplay-resolution {
    font-size: 11px;
    color: var(--pawa-muted);
    font-family: 'Courier New', monospace;
    white-space: nowrap;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 480px) {
    .pawahlsplay-controls-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .pawahlsplay-meta { display: none; }
    .pawahlsplay-q-btn { padding: 4px 10px; font-size: 11px; }
}
