/* ============================================
   ECHO24X7 LIVE TV — live-tv.css v1.0.0
   Prefix  : elt-
   Depends : echo24x7-font-awesome-6
   ============================================ */

:root {
    --elt-bg:        #111111;
    --elt-surface:   #1a1a1a;
    --elt-surface-2: #242424;
    --elt-accent:    #ef8200;
    --elt-text:      #f0f0f0;
    --elt-muted:     #888888;
    --elt-border:    #2e2e2e;
    --elt-live:      #e53935;
    --elt-radius:    14px;
}

/* ---- Wrapper ---- */
.elt-wrapper {
    background:  var(--elt-bg);
    border-radius: var(--elt-radius);
    overflow:    hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color:       var(--elt-text);
    max-width:   100%;
    box-shadow:  0 4px 24px rgba(0, 0, 0, 0.55);
}

/* ============================================
   CHANNEL STRIP
   ============================================ */

.elt-channel-strip {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 18px;
    overflow-x: auto;
    padding: 16px 20px 14px;
    background: var(--elt-surface);
    border-bottom: 1px solid var(--elt-border);
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--elt-border) var(--elt-surface);
}

.elt-channel-strip::-webkit-scrollbar        { height: 3px; }
.elt-channel-strip::-webkit-scrollbar-track  { background: var(--elt-surface); }
.elt-channel-strip::-webkit-scrollbar-thumb  { background: var(--elt-border); border-radius: 2px; }

/* ---- Bubble ---- */
.elt-channel-bubble {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    user-select: none;
}

.elt-channel-bubble:hover               { transform: scale(1.1); }
.elt-channel-bubble.active              { transform: scale(1.06); }
.elt-channel-bubble:focus-visible .elt-bubble-img-wrap {
    box-shadow: 0 0 0 3px var(--elt-accent);
}

/* ---- Bubble Image Wrap ---- */
.elt-bubble-img-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--elt-surface-2);
    border: 2.5px solid var(--elt-border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

.elt-channel-bubble.active .elt-bubble-img-wrap {
    border-color: var(--elt-accent);
    box-shadow: 0 0 0 3px rgba(239, 130, 0, 0.3), 0 4px 16px rgba(239, 130, 0, 0.2);
}

/* ---- Logo Image ---- */
.elt-bubble-logo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

/* ---- Initials Fallback ---- */
.elt-bubble-initials {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    background: linear-gradient(135deg, #2c2c2c 0%, #3a3a3a 100%);
    border-radius: 50%;
    letter-spacing: 0.5px;
}

/* ---- Bubble Name ---- */
.elt-bubble-name {
    font-size: 11px;
    color: var(--elt-muted);
    text-align: center;
    max-width: 72px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.elt-channel-bubble.active .elt-bubble-name {
    color: var(--elt-accent);
    font-weight: 600;
}

/* ============================================
   PLAYER SECTION
   ============================================ */

.elt-player-section {
    position: relative;
    background: #000;
    width: 100%;
}

.elt-player-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

/*
 * YouTube IFrame API replaces <div id="elt-player"> with <iframe id="elt-player">,
 * keeping the same ID. So #elt-player IS the iframe — style it directly.
 * Do NOT use "#elt-player iframe" — that selector would match nothing.
 */
#elt-player {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border: none;
    display: block;
}

/* ---- Empty State ---- */
.elt-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #000;
    z-index: 5;
    color: var(--elt-muted);
}

.elt-empty-state i { font-size: 52px; color: var(--elt-border); }
.elt-empty-state p { font-size: 14px; margin: 0; color: var(--elt-muted); }

/* ---- Unavailable State ---- */
.elt-unavailable {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #000;
    z-index: 6;
    color: var(--elt-muted);
}

.elt-unavailable.hidden {
    display: none;
}

.elt-unavailable i { font-size: 42px; color: #c0392b; }
.elt-unavailable p { font-size: 14px; margin: 0; color: var(--elt-muted); }

/* ---- Loading Spinner ---- */
.elt-spinner {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.65);
    z-index: 10;
    transition: opacity 0.3s ease;
}

.elt-spinner.hidden {
    opacity: 0;
    pointer-events: none;
}

.elt-spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--elt-accent);
    border-radius: 50%;
    animation: elt-spin 0.75s linear infinite;
}

@keyframes elt-spin { to { transform: rotate(360deg); } }

/* ============================================
   NOW PLAYING BAR
   ============================================ */

.elt-now-playing-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #0a0a0a;
    border-top: 1px solid var(--elt-border);
    gap: 12px;
    min-height: 48px;
}

.elt-now-playing-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

/* ---- LIVE Badge ---- */
.elt-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--elt-live);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1.2px;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.elt-live-dot {
    width: 5px;
    height: 5px;
    background: #fff;
    border-radius: 50%;
    animation: elt-blink 1.4s ease-in-out infinite;
}

@keyframes elt-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.25; }
}

/* ---- Channel Name & Description ---- */
.elt-now-playing-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--elt-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.elt-now-playing-desc {
    font-size: 11px;
    color: var(--elt-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Control Buttons ---- */
.elt-player-controls {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.elt-ctrl-btn {
    background: none;
    border: none;
    color: var(--elt-muted);
    font-size: 17px;
    cursor: pointer;
    padding: 7px 9px;
    border-radius: 7px;
    line-height: 1;
    transition: color 0.18s ease, background 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.elt-ctrl-btn:hover  { color: var(--elt-text); background: var(--elt-surface-2); }
.elt-ctrl-btn.muted  { color: var(--elt-accent); }

/* ============================================
   MOBILE
   ============================================ */

@media (max-width: 767px) {
    .elt-channel-strip {
        gap: 14px;
        padding: 12px 14px 10px;
    }

    .elt-bubble-img-wrap {
        width: 52px;
        height: 52px;
    }

    .elt-bubble-initials { font-size: 15px; }

    .elt-bubble-name {
        font-size: 10px;
        max-width: 58px;
    }

    .elt-now-playing-desc  { display: none; }
    .elt-now-playing-name  { font-size: 12px; }
}
