/**
 * IPTV Web App - Player Styles (Enhanced)
 */

/* === Player Container === */
#player-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
}

#player-container.active {
    opacity: 1;
    pointer-events: auto;
}

/* === Video Element === */
#player-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* === Loading Indicator === */
#player-container.loading::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 10;
}

/* === Error State === */
#player-container.error::before {
    content: '⚠ Error';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--error);
    font-size: 20px;
    font-weight: 600;
    z-index: 10;
}

/* === OSD Container === */
#player-osd {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 400ms ease;
    pointer-events: none;
    z-index: 20;
}

#player-osd.visible {
    opacity: 1;
    pointer-events: auto;
}

/* === Top Bar === */
.osd-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    background: linear-gradient(rgba(0,0,0,0.85), transparent);
}

.osd-top-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.osd-ch-number {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
    min-width: 50px;
    text-align: center;
}

.osd-logo {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255,255,255,0.1);
}

.osd-ch-details {
    display: flex;
    flex-direction: column;
}

.osd-channel-name {
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.osd-group {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-top: 2px;
}

.osd-top-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.osd-time {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
}

/* === Bottom Bar === */
.osd-bottom-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 30px 24px;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.6) 30%, rgba(0,0,0,0.92) 100%);
}

/* === EPG Info === */
.osd-epg-info {
    margin-bottom: 12px;
}

.osd-epg-loading,
.osd-epg-empty {
    font-size: 14px;
    color: rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
}

.osd-live-badge {
    font-size: 14px;
    font-weight: 700;
    color: var(--error);
    letter-spacing: 0.5px;
    animation: osd-live-pulse 2s infinite;
}

@keyframes osd-live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.osd-program-current {
    margin-bottom: 10px;
}

.osd-program-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.osd-now-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--accent);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}

.osd-program-time {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
}

.osd-program-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 4px;
}

.osd-program-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    max-width: 600px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 8px;
}

.osd-progress-bar-wrap {
    height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    max-width: 500px;
    overflow: hidden;
    position: relative;
}

.osd-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 1s linear;
}

/* Seekable progress bar (clickable) */
.osd-progress-seekable {
    cursor: pointer;
    height: 6px;
    overflow: visible;
    padding: 8px 0;
    margin: -8px 0;
    background-clip: content-box;
    -webkit-tap-highlight-color: transparent;
    transition: height 0.2s;
}

.osd-progress-seekable:hover {
    height: 8px;
}

.osd-progress-thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    box-shadow: 0 0 6px rgba(0,0,0,0.4);
}

.osd-progress-seekable:hover .osd-progress-thumb {
    opacity: 1;
}

/* === Live Button (timeshift return) === */
.osd-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--error);
    animation: osd-live-pulse 1.5s ease infinite;
}

.osd-live-btn-ctrl {
    color: var(--error) !important;
}

.osd-live-btn-ctrl .osd-ctrl-label {
    color: var(--error);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* === Timeshift Seek Bar === */
.osd-ts-bar {
    margin: 10px 0 8px;
    direction: ltr;
}

.osd-ts-track {
    position: relative;
    height: 6px;
    background: rgba(255,255,255,0.15);
    border-radius: 3px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.osd-ts-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    pointer-events: none;
    transition: width 0.3s linear;
}

.osd-ts-thumb {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 1px 4px rgba(0,0,0,0.5);
    transition: left 0.3s linear;
}

.osd-ts-times {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    font-variant-numeric: tabular-nums;
}

.osd-program-next {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.osd-next-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}

.osd-next-time {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

.osd-next-title {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
}

/* === Back Button === */
.osd-back-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    flex-shrink: 0;
}

.osd-back-btn:active {
    background: rgba(255,255,255,0.15);
}

.osd-back-btn svg {
    width: 24px;
    height: 24px;
}

[dir="rtl"] .osd-back-btn svg {
    transform: scaleX(-1);
}

/* === Center Touch Controls === */
.osd-center-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    direction: ltr; /* Always LTR so prev/next don't flip in RTL */
    align-items: center;
    gap: 32px;
    z-index: 25;
}

.osd-touch-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: 2px solid rgba(255,255,255,0.25);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
    transition: background 150ms, transform 150ms;
}

.osd-touch-btn:active {
    background: rgba(255,255,255,0.2);
    transform: scale(0.9);
}

.osd-touch-btn svg {
    width: 24px;
    height: 24px;
}

.osd-touch-btn-main {
    width: 64px;
    height: 64px;
    background: rgba(59,130,246,0.7);
    border-color: rgba(59,130,246,0.8);
}

.osd-touch-btn-main svg {
    width: 30px;
    height: 30px;
}

/* === Controls Bar === */
.osd-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.osd-control-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: rgba(255,255,255,0.06);
    border: 2px solid transparent;
    color: inherit;
    font: inherit;
    padding: 8px 14px;
    border-radius: 10px;
    -webkit-tap-highlight-color: transparent;
    transition: background 200ms ease, border-color 200ms ease, transform 150ms ease;
}

.osd-control-item:hover {
    background: rgba(255,255,255,0.12);
}

.osd-control-item:active {
    background: rgba(255,255,255,0.15);
    transform: scale(0.96);
}

.osd-control-item.focused {
    background: var(--accent-glow);
    border-color: var(--accent);
}

.osd-control-item.focused .osd-ctrl-icon {
    color: #93c5fd;
}

.osd-control-item.focused .osd-ctrl-label {
    color: rgba(255,255,255,0.85);
}

.osd-ctrl-icon {
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    display: flex;
    align-items: center;
}

.osd-ctrl-label {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    font-weight: 500;
}

/* Hide desktop-only play/pause button on mobile (center controls replace it) */
@media (max-width: 1024px) {
    .osd-desktop-only {
        display: none;
    }
}

/* === Hide center controls on desktop (keyboard/remote handles it) === */
@media (min-width: 1025px) {
    .osd-center-controls {
        display: none;
    }

    .osd-back-btn {
        display: none;
    }
}

/* === Channel List Overlay === */
.player-channel-list {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 380px;
    background: rgba(10, 14, 23, 0.95);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    animation: slideIn 250ms ease;
}

[dir="rtl"] .player-channel-list {
    right: 0;
}

[dir="ltr"] .player-channel-list {
    left: 0;
}

@keyframes slideIn {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRTL {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

[dir="rtl"] .player-channel-list {
    animation-name: slideInRTL;
}

.player-ch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 600;
    font-size: 16px;
}

/* === Player Category Tabs === */
.player-ch-categories {
    display: flex;
    gap: 6px;
    padding: 8px 16px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.player-ch-categories::-webkit-scrollbar {
    display: none;
}

.player-cat-tab {
    padding: 5px 14px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.5);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 150ms ease;
    flex-shrink: 0;
}

.player-cat-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.player-cat-tab:hover:not(.active) {
    background: rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.8);
}

.player-ch-count {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
    font-weight: 400;
}

.player-ch-scroll {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.player-ch-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background 150ms ease;
    border-inline-start: 3px solid transparent;
}

.player-ch-item:hover {
    background: rgba(255,255,255,0.05);
}

.player-ch-item.active {
    background: var(--accent-glow);
    border-inline-start-color: var(--accent);
}

.player-ch-num {
    font-size: 13px;
    color: rgba(255,255,255,0.3);
    min-width: 28px;
    text-align: center;
}

.player-ch-logo {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(255,255,255,0.05);
}

.player-ch-logo-ph {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--accent);
    font-size: 16px;
}

.player-ch-info {
    flex: 1;
    min-width: 0;
}

.player-ch-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: rgba(255,255,255,0.85);
}

.player-ch-item.active .player-ch-name {
    color: white;
    font-weight: 600;
}

.player-ch-epg {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.player-ch-fav {
    color: var(--warning);
    font-size: 14px;
}

/* === Channel List Search === */
.player-ch-search-wrap {
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.player-ch-search {
    width: 100%;
    padding: 8px 12px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: white;
    font-size: 13px;
    outline: none;
    transition: border-color 200ms ease;
    box-sizing: border-box;
}

.player-ch-search:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.12);
}

.player-ch-search::placeholder {
    color: rgba(255,255,255,0.3);
}

/* Channel list zone focus indicators */
.player-ch-search-wrap.zone-focused .player-ch-search {
    border-color: var(--accent);
    background: rgba(255,255,255,0.12);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
}

.player-ch-categories.zone-focused {
    background: rgba(59, 130, 246, 0.08);
    border-radius: 4px;
}

.player-cat-tab.highlight {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
}

.player-cat-tab.active.highlight {
    outline: 2px solid white;
}

/* === Channel List Progress Bar === */
.player-ch-progress {
    height: 2px;
    background: rgba(255,255,255,0.1);
    border-radius: 1px;
    margin-top: 3px;
    overflow: hidden;
}

.player-ch-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 1px;
    transition: width 1s linear;
}

/* === Channel List Empty State === */
.player-ch-empty {
    padding: 40px 20px;
    text-align: center;
    color: rgba(255,255,255,0.3);
    font-size: 14px;
}

/* === Channel List Keyboard Highlight === */
.player-ch-item.highlight {
    background: var(--accent-glow);
    border-color: var(--accent);
}

/* === EPG Program Navigation (LEFT/RIGHT browsing) === */
.osd-program-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.osd-program-nav .osd-nav-arrow {
    color: rgba(255,255,255,0.15);
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s, background 0.2s, transform 0.15s;
    padding: 0;
    font: inherit;
}

.osd-program-nav .osd-nav-arrow.active {
    color: var(--accent);
    background: var(--accent-glow);
}

.osd-program-nav .osd-nav-arrow.active:hover {
    background: rgba(59, 130, 246, 0.3);
}

.osd-program-nav .osd-nav-arrow.active:active {
    transform: scale(0.9);
    background: rgba(59, 130, 246, 0.4);
}

.osd-program-nav .osd-nav-arrow:disabled {
    cursor: default;
    opacity: 0.3;
    background: none;
}

.osd-program-nav .osd-nav-arrow svg {
    width: 24px;
    height: 24px;
}

.osd-program-browse-info {
    flex: 1;
    min-width: 0;
}

/* Status badges for past/future programs */
.osd-badge-past {
    background: rgba(255,255,255,0.15) !important;
    color: rgba(255,255,255,0.7) !important;
}

.osd-badge-future {
    background: rgba(59, 130, 246, 0.3) !important;
    color: #93c5fd !important;
}

/* Dimming for non-current programs */
.osd-program-past .osd-program-title,
.osd-program-past .osd-program-desc {
    opacity: 0.7;
}

.osd-program-future .osd-program-title,
.osd-program-future .osd-program-desc {
    opacity: 0.7;
    font-style: italic;
}

/* Zone focus indicator */
.osd-epg-info.zone-focused {
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.08);
    outline: 2px solid rgba(59, 130, 246, 0.4);
    outline-offset: 2px;
    padding: 8px;
    margin: -8px -8px 4px;
}

.osd-ts-bar.zone-focused {
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.08);
    outline: 2px solid rgba(59, 130, 246, 0.4);
    outline-offset: 2px;
    padding: 10px 8px;
    margin: -4px -8px 4px;
}

.osd-ts-bar.zone-focused .osd-ts-track {
    height: 8px;
}

.osd-ts-bar.zone-focused .osd-ts-thumb {
    width: 18px;
    height: 18px;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.osd-controls.zone-focused {
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    outline: 1px solid rgba(255,255,255,0.08);
    outline-offset: 2px;
    padding: 12px 8px;
    margin: 0 -8px;
}

/* Snap-to-NOW button */
.osd-snap-now {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.5);
    color: #4ade80;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s, transform 0.15s;
    font-family: inherit;
}

.osd-snap-now:hover {
    background: rgba(34, 197, 94, 0.35);
}

.osd-snap-now:active {
    transform: scale(0.95);
}

/* Play Catchup button — shown on past programs */
.osd-catchup-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(251, 146, 60, 0.2);
    border: 1px solid rgba(251, 146, 60, 0.5);
    color: #fb923c;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.2s, transform 0.15s;
    font-family: inherit;
    margin-top: 6px;
}
.osd-catchup-btn:hover {
    background: rgba(251, 146, 60, 0.35);
}
.osd-catchup-btn:active {
    transform: scale(0.95);
}
.osd-catchup-btn svg {
    flex-shrink: 0;
}
.osd-catchup-hint {
    font-size: 10px;
    opacity: 0.6;
    font-weight: 400;
}

/* Catchup badge in OSD top bar */
.osd-catchup-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(251, 146, 60, 0.15);
    border: 1px solid rgba(251, 146, 60, 0.4);
    color: #fb923c;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 14px;
    margin-inline-start: 12px;
}
.osd-catchup-badge svg {
    flex-shrink: 0;
}
.osd-catchup-program-title {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   TV-STYLE OSD ENHANCEMENTS
   ============================================================ */

/* === Slide Animations for OSD elements === */
#player-osd.visible .osd-top-bar {
    animation: osd-slide-down 350ms ease-out both;
}
#player-osd.visible .osd-bottom-bar {
    animation: osd-slide-up 350ms ease-out both;
}
#player-osd.visible .osd-center-controls {
    animation: osd-fade-scale 300ms ease-out 100ms both;
}
#player-osd.visible .osd-banner {
    animation: osd-slide-up 300ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes osd-slide-up {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
@keyframes osd-slide-down {
    from { transform: translateY(-40px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
@keyframes osd-fade-scale {
    from { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
    to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* === Channel Number Zap Overlay === */
.osd-zap-overlay {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    padding: 14px 40px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 300ms ease;
    z-index: 40;
    pointer-events: none;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
.osd-zap-overlay.visible {
    opacity: 1;
}
.osd-zap-digits {
    font-size: 72px;
    font-weight: 800;
    color: white;
    font-variant-numeric: tabular-nums;
    letter-spacing: 6px;
    text-shadow: 0 2px 12px rgba(59, 130, 246, 0.4);
}

/* === Channel Transition Overlay === */
.osd-transition {
    position: absolute;
    inset: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 250ms ease;
}
.osd-transition.active {
    opacity: 1;
}
.osd-transition-num {
    font-size: 72px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
    font-variant-numeric: tabular-nums;
    animation: osd-transition-pop 500ms ease-out both;
}
@keyframes osd-transition-pop {
    0%   { transform: scale(0.6); opacity: 0; }
    50%  { transform: scale(1.05); opacity: 0.7; }
    100% { transform: scale(1); opacity: 0.5; }
}

/* === TV Info Banner (compact, bottom-anchored) === */
.osd-banner {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 30px 22px;
    background: linear-gradient(transparent 0%, rgba(0, 0, 0, 0.75) 30%, rgba(0, 0, 0, 0.92) 100%);
}

.osd-banner-num {
    font-size: 42px;
    font-weight: 800;
    color: var(--accent);
    min-width: 56px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.osd-banner-logo {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.osd-banner-info {
    min-width: 0;
    flex-shrink: 0;
    max-width: 200px;
}
.osd-banner-name {
    font-size: 18px;
    font-weight: 700;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.osd-banner-group {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 2px;
}

.osd-banner-divider {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}

.osd-banner-program {
    flex: 1;
    min-width: 0;
}
.osd-banner-program-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}
.osd-banner-now {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--accent);
    color: white;
    padding: 2px 7px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.osd-banner-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    flex-shrink: 0;
}
.osd-banner-title {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.osd-banner-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}
.osd-banner-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 1s linear;
}
.osd-banner-next {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}
.osd-banner-next-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
    flex-shrink: 0;
}
.osd-banner-next-title {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.osd-banner-clock {
    font-size: 22px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    margin-inline-start: auto;
}

/* === No Signal Overlay === */
.osd-no-signal {
    position: absolute;
    inset: 0;
    background: #0a0a0a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 15;
    opacity: 0;
    pointer-events: none;
    transition: opacity 400ms ease;
}
.osd-no-signal.visible {
    opacity: 1;
    pointer-events: auto;
}
.osd-no-signal::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(255, 255, 255, 0.02) 2px,
        rgba(255, 255, 255, 0.02) 4px
    );
    opacity: 0.8;
    animation: static-drift 4s linear infinite;
    pointer-events: none;
}
@keyframes static-drift {
    from { background-position: 0 0; }
    to   { background-position: 0 200px; }
}
.osd-no-signal-icon {
    color: rgba(255, 255, 255, 0.25);
    animation: no-signal-pulse 2s ease infinite;
}
@keyframes no-signal-pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 0.2; }
}
.osd-no-signal-text {
    font-size: 24px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    z-index: 1;
}
.osd-no-signal-retry {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.25);
    z-index: 1;
}

/* === Loading / Tuning State === */
#player-container.loading .osd-transition {
    /* Don't show transition overlay during tuning — let spinner handle it */
}
#player-container.tuning::after {
    content: attr(data-tuning-text);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 18px;
    font-weight: 600;
    z-index: 12;
    text-align: center;
    white-space: nowrap;
}
