/* ==========================================================================
   Быстрый ТВ - Claude Palette Theme
   Warm terracotta accent: #D97757
   Dark warm charcoal: #181816 / #1F1E1B
   Ivory paper text: #FAF7F2
   Muted text: #B5ADA4
   ========================================================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #181816;
    color: #FAF7F2;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Make background transparent when video is active */
body.video-active {
    background-color: transparent !important;
}

#video-surface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    background-color: transparent;
}

#avplay-object {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    border: none;
    background-color: transparent;
}

#html-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: fill; /* Default full stretch */
    display: none;
    background-color: #000000;
}

.hidden {
    display: none !important;
}

/* Screen Navigation Click Zones - Disabled for Native TV remote experience */
.screen-zone {
    display: none !important;
}

.zone-left {
    left: 0;
    justify-content: flex-start;
    padding-left: 30px;
    background: linear-gradient(90deg, rgba(24, 24, 22, 0.45) 0%, transparent 100%);
}

.zone-right {
    right: 0;
    justify-content: flex-end;
    padding-right: 30px;
    background: linear-gradient(-90deg, rgba(24, 24, 22, 0.45) 0%, transparent 100%);
}

.screen-zone:hover,
body.show-controls .screen-zone {
    opacity: 0.9;
}

.zone-arrow {
    font-size: 44px;
    font-weight: 800;
    color: #FAF7F2;
    background: rgba(36, 34, 30, 0.85);
    border: 2px solid rgba(217, 119, 87, 0.5);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

.zone-arrow:hover {
    background: #D97757;
    border-color: #FAF7F2;
    transform: scale(1.05);
}

/* Top Floating Toolbar - Completely hidden for clean native TV app look */
.top-toolbar {
    display: none !important;
}

.tb-btn {
    background: rgba(30, 29, 26, 0.75);
    border: 1px solid rgba(250, 247, 242, 0.14);
    color: #FAF7F2;
    font-size: 20px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 9999px; /* Pill shape */
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    transition: all 0.2s ease;
}

.tb-btn:hover {
    border-color: #D97757;
    background: rgba(45, 43, 38, 0.95);
    box-shadow: 0 4px 20px rgba(217, 119, 87, 0.25);
}

.tb-btn.highlight {
    background: #D97757;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #FAF7F2;
}

.tb-btn.highlight:hover {
    background: #E28567;
    border-color: #FAF7F2;
}

/* OSD Banner & Claude Scrub Bar (Bottom) */
.osd {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 290px;
    z-index: 20;
    background: linear-gradient(0deg, rgba(20, 19, 16, 0.98) 0%, rgba(20, 19, 16, 0.90) 65%, rgba(20, 19, 16, 0) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0 60px 32px 60px;
    pointer-events: none;
    transform: translateZ(0);
}

.osd-content {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 8px;
}

/* Claude Bottom Timeline Scrub Bar */
.timeline-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 16px;
    pointer-events: auto;
}

.time-label {
    font-size: 20px;
    font-weight: 600;
    color: #B5ADA4;
    min-width: 65px;
    letter-spacing: 0.5px;
}

.timeline-bar {
    flex: 1;
    height: 8px;
    background: rgba(250, 247, 242, 0.16);
    border-radius: 9999px;
    position: relative;
    cursor: pointer;
    transition: height 0.2s ease;
}

.timeline-bar:hover {
    height: 12px;
}

.timeline-buffered {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(250, 247, 242, 0.26);
    border-radius: 9999px;
    width: 0%;
    pointer-events: none;
}

.timeline-progress {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #D97757;
    border-radius: 9999px;
    width: 0%;
    pointer-events: none;
    box-shadow: 0 0 10px rgba(217, 119, 87, 0.4);
}

.timeline-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background: #FAF7F2;
    border: 2.5px solid #D97757;
    border-radius: 50%;
    box-shadow: 0 0 12px rgba(217, 119, 87, 0.6);
    pointer-events: none;
    transition: transform 0.15s ease;
}

.timeline-bar:hover .timeline-thumb {
    transform: translate(-50%, -50%) scale(1.25);
}

.osd-main {
    display: flex;
    align-items: center;
    gap: 35px;
}

.osd-num {
    font-size: 82px;
    font-weight: 800;
    color: #D97757;
    line-height: 1;
    letter-spacing: -2px;
    min-width: 130px;
    text-shadow: 0 4px 18px rgba(217, 119, 87, 0.35);
}

.osd-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.osd-epg {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.osd-epg-current {
    font-size: 22px;
    color: #F4ECE1;
    font-weight: 500;
    line-height: 1.25;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    max-width: 1100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.osd-epg-next {
    font-size: 16px;
    color: #A8A29E;
    line-height: 1.2;
    max-width: 1100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.osd-title {
    font-size: 42px;
    font-weight: 700;
    color: #FAF7F2;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
    max-width: 1100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.badge {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 19px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.group-badge {
    background: rgba(217, 119, 87, 0.18);
    border: 1px solid rgba(217, 119, 87, 0.35);
    color: #FAF7F2;
}

.aspect-badge {
    background: rgba(250, 247, 242, 0.12);
    border: 1px solid rgba(250, 247, 242, 0.2);
    color: #FAF7F2;
}

.quality-badge {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(52, 211, 153, 0.4);
    color: #6ee7b7;
}

.osd-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.osd-clock {
    font-size: 46px;
    font-weight: 700;
    color: #FAF7F2;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.osd-hint {
    font-size: 18px;
    font-weight: 500;
    color: #B5ADA4;
    background: rgba(30, 28, 24, 0.6);
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Number Dial Box (Top-Right) */
.dial-box {
    position: absolute;
    top: 50px;
    right: 60px;
    z-index: 30;
    background: rgba(28, 27, 24, 0.95);
    border: 3px solid #D97757;
    border-radius: 16px;
    padding: 16px 36px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 24px rgba(217, 119, 87, 0.35);
}

.dial-digits {
    font-size: 88px;
    font-weight: 800;
    color: #FAF7F2;
    letter-spacing: 2px;
}

.cursor {
    font-size: 88px;
    font-weight: 800;
    color: #D97757;
    animation: blink 0.8s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Toast (Aspect Mode, Seek, Volume) */
.toast {
    position: absolute;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 35;
    background: rgba(28, 27, 24, 0.96);
    border: 2px solid #D97757;
    border-radius: 16px;
    padding: 16px 36px;
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 30px;
    font-weight: 700;
    color: #FAF7F2;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.85), 0 0 20px rgba(217, 119, 87, 0.3);
}

#toast-icon {
    font-size: 36px;
    color: #D97757;
}

/* Buffering Spinner */
.buffering {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    background: rgba(28, 27, 24, 0.82);
    padding: 30px 48px;
    border-radius: 20px;
    border: 1px solid rgba(217, 119, 87, 0.3);
    backdrop-filter: blur(10px);
}

.spinner {
    width: 64px;
    height: 64px;
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-top-color: #D97757;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.buffering-text {
    font-size: 24px;
    font-weight: 600;
    color: #FAF7F2;
}

/* Notice / Error Toast */
.notice {
    position: absolute;
    bottom: 270px;
    left: 60px;
    z-index: 30;
    background: rgba(185, 28, 28, 0.92);
    border: 2px solid #ef4444;
    border-radius: 12px;
    padding: 14px 28px;
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
}

/* Channel List Guide (Left Drawer Overlay) */
.channel-list {
    position: absolute;
    top: 0;
    left: 0;
    width: 600px;
    height: 100vh;
    z-index: 50;
    background: rgba(24, 23, 20, 0.97);
    border-right: 2px solid rgba(217, 119, 87, 0.35);
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    transform: translateZ(0);
}

.list-header {
    padding: 32px 40px 22px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.list-title {
    font-size: 34px;
    font-weight: 800;
    color: #FAF7F2;
}

.list-count {
    font-size: 20px;
    font-weight: 600;
    color: #D97757;
}

.close-list-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #FAF7F2;
    font-size: 24px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.close-list-btn:hover {
    background: #D97757;
    border-color: #FAF7F2;
}

.list-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    position: relative;
}

.channel-item {
    display: flex;
    align-items: center;
    padding: 18px 40px;
    gap: 22px;
    cursor: pointer;
    border-left: 5px solid transparent;
    transition: background 0.15s ease;
}

.channel-item:hover,
.channel-item.selected {
    background: rgba(217, 119, 87, 0.2);
    border-left-color: #D97757;
}

.channel-item.playing {
    color: #D97757;
}

.channel-item-num {
    font-size: 28px;
    font-weight: 700;
    color: #B5ADA4;
    min-width: 60px;
}

.channel-item.selected .channel-item-num,
.channel-item:hover .channel-item-num {
    color: #D97757;
}

.channel-item-content {
    flex: 1;
    overflow: hidden;
}

.channel-item-title {
    font-size: 26px;
    font-weight: 600;
    color: #FAF7F2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-item-group {
    font-size: 16px;
    font-weight: 500;
    color: #8C847A;
    margin-top: 4px;
    text-transform: uppercase;
}

.channel-item.selected .channel-item-title,
.channel-item:hover .channel-item-title {
    color: #FAF7F2;
    font-weight: 700;
}

.channel-item.selected .channel-item-group,
.channel-item:hover .channel-item-group {
    color: #E28567;
}

.list-footer {
    padding: 24px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    font-weight: 600;
    color: #B5ADA4;
}
