/* ==========================================================================
   HLS Stream Player – Frontend Styles
   ========================================================================== */

:root {
    --hsp-color: #e53e3e;
    --hsp-bg: #0d0d0d;
    --hsp-surface: #1a1a1a;
    --hsp-border: rgba(255,255,255,.07);
    --hsp-text: #f0f0f0;
    --hsp-muted: #888;
    --hsp-radius: 10px;
    --hsp-font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* Wrapper ------------------------------------------------------------------ */
.hsp-wrapper {
    font-family: var(--hsp-font);
    background: var(--hsp-bg);
    border: 1px solid var(--hsp-border);
    border-radius: var(--hsp-radius);
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,.55);
    max-width: 100%;
}

/* Header ------------------------------------------------------------------- */
.hsp-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--hsp-surface);
    border-bottom: 1px solid var(--hsp-border);
}

.hsp-live-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--hsp-color);
    flex-shrink: 0;
    box-shadow: 0 0 0 0 var(--hsp-color);
    animation: hsp-pulse 1.8s ease-in-out infinite;
}

@keyframes hsp-pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hsp-color) 70%, transparent); }
    70%  { box-shadow: 0 0 0 7px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}

.hsp-title {
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--hsp-text);
}

/* Video area --------------------------------------------------------------- */
.hsp-video-wrap {
    position: relative;
    background: #000;
    overflow: hidden;
}

.hsp-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Overlay (loading) -------------------------------------------------------- */
.hsp-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.72);
    gap: 14px;
    z-index: 5;
    transition: opacity .4s;
}

.hsp-overlay.hsp-hidden {
    opacity: 0;
    pointer-events: none;
}

.hsp-spinner {
    width: 48px;
    height: 48px;
    animation: hsp-spin 1s linear infinite;
}

.hsp-spinner circle {
    stroke: var(--hsp-color);
    stroke-dasharray: 80;
    stroke-dashoffset: 20;
    stroke-linecap: round;
}

@keyframes hsp-spin {
    to { transform: rotate(360deg); }
}

.hsp-overlay-msg {
    margin: 0;
    color: rgba(255,255,255,.7);
    font-size: .8rem;
    letter-spacing: .03em;
}

/* Error overlay ------------------------------------------------------------ */
.hsp-error-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.82);
    gap: 12px;
    z-index: 6;
    color: #fff;
    text-align: center;
    padding: 20px;
}

.hsp-error-icon {
    width: 40px;
    height: 40px;
    stroke: var(--hsp-color);
    opacity: .85;
}

.hsp-error-overlay p {
    margin: 0;
    font-size: .85rem;
    color: rgba(255,255,255,.75);
    max-width: 260px;
}

.hsp-retry-btn {
    background: var(--hsp-color);
    color: #fff;
    border: none;
    padding: 8px 22px;
    border-radius: 5px;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .15s;
}

.hsp-retry-btn:hover {
    opacity: .85;
    transform: translateY(-1px);
}

/* Footer ------------------------------------------------------------------- */
.hsp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 12px;
    background: var(--hsp-surface);
    border-top: 1px solid var(--hsp-border);
    min-height: 32px;
}

.hsp-quality {
    font-size: .72rem;
    font-family: monospace;
    color: var(--hsp-muted);
    letter-spacing: .04em;
}

.hsp-fullscreen-btn {
    display: flex;
    align-items: center;
    color: var(--hsp-muted);
    text-decoration: none;
    transition: color .2s;
}

.hsp-fullscreen-btn:hover {
    color: var(--hsp-text);
}

.hsp-fullscreen-btn svg {
    width: 16px;
    height: 16px;
}

/* Error inline (no URL) ---------------------------------------------------- */
p.hsp-error {
    background: #1a0000;
    border-left: 3px solid var(--hsp-color, #e53e3e);
    color: #faa;
    padding: 10px 14px;
    font-size: .85rem;
    border-radius: 4px;
}
