/**
 * CiMovie - Custom TV Video Player Styles (LG webOS TV)
 * 10-Foot UI/UX Pro Max: Fullscreen canvas, 14px Scrubber Track with Thumb,
 * 10-Foot Transport Controls, SVG Icons, and Error Recovery Overlay.
 */

#player-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    background: #000000;
    z-index: 9999;
    display: none;
    overflow: hidden;
}

#player-screen.active {
    display: block;
}

#tv-video-element {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000000;
}

/* 10-Foot Buffering Spinner */
#player-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 88px;
    height: 88px;
    border: 7px solid rgba(255, 255, 255, 0.18);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1.1s infinite linear;
    display: none;
    z-index: 1000;
}

#player-spinner.active {
    display: block;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ==========================================================================
   Player On-Screen Display (OSD)
   ========================================================================== */
#player-osd {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--safe-top) var(--safe-side) var(--safe-bottom) var(--safe-side);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.3) 25%, rgba(0, 0, 0, 0.3) 70%, rgba(0, 0, 0, 0.95) 100%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 500;
}

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

/* OSD Top Bar */
.osd-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.osd-header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.player-icon-btn {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.15);
    border: 2.5px solid transparent;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-icon-btn svg {
    width: 26px;
    height: 26px;
    fill: currentColor;
}

.player-title-info h2 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.player-title-info span {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* OSD Bottom Bar */
.osd-bottom-bar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 10-Foot Timeline Track & Scrubber */
.player-timeline-wrapper {
    display: flex;
    align-items: center;
    gap: 24px;
}

.time-label {
    font-size: 16px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: #ffffff;
    width: 85px;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.player-progress-track {
    flex: 1;
    height: 14px;
    background: rgba(255, 255, 255, 0.24);
    border-radius: 7px;
    position: relative;
    cursor: pointer;
    overflow: visible;
    outline: none;
    border: 2px solid transparent;
    transition: height 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.player-progress-track.focused,
.player-progress-track:focus {
    height: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.35);
    border-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(229, 9, 20, 0.6), 0 0 24px rgba(229, 9, 20, 0.85);
}

.player-progress-fill {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 0%;
    background: var(--accent-primary);
    border-radius: 7px;
    transition: width 0.15s linear;
}

.player-progress-track.focused .player-progress-fill,
.player-progress-track:focus .player-progress-fill {
    border-radius: 10px;
}

.player-progress-fill::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
    transition: width 0.2s ease, height 0.2s ease, box-shadow 0.2s ease;
}

.player-progress-track.focused .player-progress-fill::after,
.player-progress-track:focus .player-progress-fill::after {
    width: 28px;
    height: 28px;
    box-shadow: 0 0 16px rgba(0, 0, 0, 0.9), 0 0 0 4px var(--accent-primary);
}

/* Controls Bar */
.player-controls-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 36px;
}

.player-ctrl-btn {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.14);
    border: 2.5px solid transparent;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
    position: relative;
}

.player-ctrl-btn svg {
    width: 30px;
    height: 30px;
    fill: currentColor;
}

.player-ctrl-btn .skip-badge {
    position: absolute;
    bottom: -6px;
    background: #080b11;
    border: 1px solid var(--border-subtle);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    padding: 1px 4px;
    color: var(--text-secondary);
}

.player-ctrl-btn.primary {
    width: 88px;
    height: 88px;
    background: var(--accent-primary);
    box-shadow: 0 6px 24px rgba(229, 9, 20, 0.5);
}

.player-ctrl-btn.primary svg {
    width: 40px;
    height: 40px;
}

/* ==========================================================================
   TV Player Error & Retry Overlay
   ========================================================================== */
.player-error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 6, 10, 0.92);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-error-box {
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 48px 56px;
    max-width: 840px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.player-error-box .error-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    margin-bottom: 6px;
}

.player-error-box .error-icon svg {
    width: 64px;
    height: 64px;
    fill: currentColor;
}

.player-error-box .error-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

.player-error-box .error-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.65;
    margin-bottom: 14px;
    max-width: 680px;
}

.player-error-box .error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: center;
}

.player-error-box .error-actions button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.player-error-box .error-actions button .icon svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}
