@import url('https://api.fontshare.com/v2/css?f[]=satoshi@400&display=swap');
* { font-family: 'Satoshi', sans-serif; }
html, body { margin: 0; padding: 0; background-color: #121212; font-family: system-ui, sans-serif; color: white; height: 100%; width: 100%; overflow-x: hidden; overflow-y: auto; }
a { color: #ccc; font-size: 12px; text-decoration: none; }
a:hover { color: white; }

#loadingScreen { position: fixed; inset: 0; background: #121212; display: flex; flex-direction: column; justify-content: center; align-items: center; z-index: 9999; transition: opacity 0.6s ease, visibility 0.6s ease; }
#loadingScreen.hidden { opacity: 0; visibility: hidden; }
.spinner { width: 70px; height: 70px; border: 6px solid rgba(0,255,255,0.2); border-top: 6px solid #00FFFF; border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-text { font-size: 18px; color: #00FFFF; text-align: center; letter-spacing: 1px; }

#popupOverlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display: flex; justify-content: center; align-items: center; z-index: 9998; opacity: 0; visibility: hidden; transition: opacity 0.4s ease, visibility 0.4s ease; }
#popupOverlay.active { opacity: 1; visibility: visible; }
.popupBox { background: #1e1e1e; border: 1px solid rgba(0,255,255,0.3); border-radius: 12px; padding: 20px 25px; text-align: center; max-width: 350px; box-shadow: 0 0 15px rgba(0,255,255,0.2); }
.popupBox h2 { color: #00FFFF; margin-bottom: 10px; }
.popupBox p { font-size: 13px; color: #888; margin-bottom: 15px; }
.popupBox button { background: #00FFFF; color: #000; border: none; padding: 10px 18px; border-radius: 6px; cursor: pointer; font-weight: bold; transition: background 0.3s ease; }
.popupBox button:hover { background: #00cfcf; }

.container { display: flex; height: 100%; width: 100%; gap: 1rem; padding: 1rem; box-sizing: border-box; }
.video-container { position: relative; flex: 1; background-color: black; border-radius: 0.75rem; overflow: hidden; display: flex; justify-content: center; align-items: center; }
#player, #player .jwplayer, .jwplayer { width: 100% !important; height: 100% !important; position: absolute !important; top: 0; left: 0; }
#fallbackMessage { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0); color: #00FFFF; display: flex; align-items: center; justify-content: center; font-size: 24px; text-align: center; z-index: 900; }
#clock { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); background-color: #00FFFF; color: black; padding: 5px 15px; border-radius: 20px; font-size: 15px; z-index: 1000; }
.sidebar { width: 320px; background-color: #222; border-radius: 0.75rem; display: flex; flex-direction: column; padding: 1rem; box-sizing: border-box; overflow: hidden; }
.top-controls { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 0.75rem; }
select, input { background-color: #2a2a2a; color: white; border: none; border-radius: 0.375rem; padding: 0.5rem; font-size: 0.875rem; }
input.search-input { margin-top: 0.5rem; }
.channel-text { text-align: center; font-size: 25px; margin-bottom: 2px; width: 100%; }
.credits { text-align: center; font-size: 12px; color: #888; width: 100%; }
#channelCount { text-align: center; font-size: 14px; margin-bottom: 5px; color: #00FFFF; }
.list-container { flex: 1; overflow-y: auto; }
ul.channel-list { list-style: none; padding: 0; margin: 0; }
ul.channel-list li { padding: 0.5rem; cursor: pointer; border-radius: 0.375rem; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
ul.channel-list li.active { background-color: #00FFFF; color: black }
ul.channel-list li:hover:not(.active) { background-color: #333; }
.list-container::-webkit-scrollbar { width: 8px; }
.list-container::-webkit-scrollbar-track { background: #1c1c1c; border-radius: 4px; }
.list-container::-webkit-scrollbar-thumb { background-color: #444; border-radius: 4px; border: 2px solid #1c1c1c; }
.list-container::-webkit-scrollbar-thumb:hover { background-color: #00FFFF; }

.jwplayer .jw-controlbar { background: linear-gradient(to top, rgba(0, 255, 255, 0.4), rgba(18, 18, 18, 0.2)) !important; backdrop-filter: blur(6px); }
.jwplayer .jw-button-color, .jwplayer .jw-icon, .jwplayer .jw-text-elapsed, .jwplayer .jw-text-duration { color: rgba(0, 255, 255, 0.7) !important; fill: rgba(0, 255, 255, 0.7) !important; transition: color 0.3s ease; }
.jwplayer .jw-icon:hover { color: #00FFFF !important; fill: #00FFFF !important; }
.jwplayer .jw-progress, .jwplayer .jw-slider-volume .jw-progress, .jwplayer .jw-knob { background-color: rgba(0, 255, 255, 0.5) !important; }
.jwplayer .jw-slider-volume .jw-knob, .jwplayer .jw-slider-horizontal .jw-knob { background-color: #00FFFF !important; }
.jwplayer .jw-background-color { background-color: transparent !important; }
.jw-settings-menu, .jw-settings-submenu, .jw-rightclick { background: linear-gradient(145deg, #121212 0%, #0a1a1f 100%) !important; border: 1px solid rgba(0, 255, 255, 0.3) !important; box-shadow: 0 0 10px rgba(0, 255, 255, 0.15); }
.jw-settings-topbar { background: linear-gradient(145deg, #121212 0%, #0a1a1f 100%) !important; }
.jw-settings-topbar .jw-settings-topbar-text.jw-active-tab { border-bottom: 2px solid #00FFFF !important; color: #00FFFF !important; }
.jw-settings-close { color: #fff !important; }
.jw-settings-close:hover { color: #00FFFF !important; }
.jw-settings-active { color: #00FFFF !important; font-weight: bold; }
.jw-settings-content-item, .jw-rightclick .jw-rightclick-item { color: #ddd !important; }
.jw-settings-content-item:hover, .jw-rightclick .jw-rightclick-item:hover { background: rgba(0, 255, 255, 0.08) !important; color: #00FFFF !important; }
.jw-rightclick .jw-rightclick-item:hover { background: rgba(0, 255, 255, 0.12) !important; color: #00FFFF !important; }
.jw-svg-icon-buffer path { display: none; }
.jw-svg-icon-buffer { background-image: url('https://gifyu.com/image/bKGoY'); background-repeat: no-repeat; background-position: center; background-size: 80px 80px; width: 80px; height: 80px; opacity: 0.8; }

@media screen and (max-width: 768px), (orientation: portrait) {
    .popupBox { width: 50%; height: none; padding: 15px; }
    .popupBox h2 { font-size: 16px; }
    .popupBox p { font-size: 12px; }
    .popupBox button { padding: 8px 12px; font-size: 12px; }
    .container { flex-direction: column; height: auto; overflow-y: auto; }
    .video-container { width: 100%; aspect-ratio: 16 / 9; height: auto; margin-bottom: 0.5rem; border-radius: 0.5rem; position: relative; }
    .sidebar { width: 100%; max-height: none; height: auto; overflow-y: auto; }
    .list-container { max-height: 240px; overflow-y: auto; }
    #fallbackMessage { display: flex; align-items: center;  justify-content: center; text-align: center; font-size: 16px; }
    #clock { font-size: 12px; padding: 4px 10px; border-radius: 15px; }
    .jw-svg-icon-buffer { background-size: 40px 40px; width: 40px; height: 40px; opacity: 0.6; }
}