:root {
    --sidebar-bg: #181c24;
    --sidebar-bg-light: #f9fafb;
    --sidebar-primary: #2563eb;
    --sidebar-border: #232730;
    --sidebar-border-light: #e5e7eb;
    --sidebar-radius: 0px;
    --sidebar-shadow: 0 4px 40px 0 rgba(0,0,0,0.11);
}

* {
    box-sizing: border-box;
	text-decoration: none;
}

body {
    margin: 0;
    padding: 0;
    background: #121212;
    color: #e0e0e0;
    font-family: 'Segoe UI', 'Inter', Arial, sans-serif;
    transition: background 0.3s, color 0.3s;
    overflow: hidden; /* Prevent body scrolling */
    width: 100vw;
    max-width: 100%;
}

body.light {
    background: #f7f9fa;
    color: #222;
}

.container {
    display: flex;
    height: 100vh;
    position: relative;
    overflow: hidden; /* Avoid horizontal scrollbars */
}

#player {
    width: 100%;
    height: 100vh;
    object-fit: cover;
    background: #000;
}

/* Ensure top controls stay visible in full-screen mode */
.top-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 12px;
    z-index: 2147483647; /* Maximum z-index to stay above full-screen video */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.top-controls.hidden-ui {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
}

.theme-toggle-btn, .sidebar-toggle {
    background: rgba(25, 28, 36, 0.8);
    color: white;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.2s;
}

body.light .theme-toggle-btn, body.light .sidebar-toggle {
    background: rgba(255, 255, 255, 0.8);
    color: #222;
}

.theme-toggle-btn:hover, .sidebar-toggle:hover {
    transform: scale(1.1);
    background: var(--sidebar-primary);
    color: white;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    height: 100vh;
    background: #1a1d23;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 10px 0 30px rgba(0,0,0,0.3);
    border-right: 1px solid rgba(255,255,255,0.05);
}

body.light .sidebar {
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    box-shadow: 10px 0 30px rgba(0,0,0,0.05);
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 25px 20px;
    background: rgba(0,0,0,0.2);
}

body.light .sidebar-header {
    background: #f9fafb;
    border-bottom: 1px solid #f1f5f9;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.search-panel {
    padding: 0 20px;
    margin: 10px 0px;
}

.search-panel input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--sidebar-border);
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
}

body.light .search-panel input {
    background: white;
    border-color: var(--sidebar-border-light);
    color: #222;
}

.channel-list {
    flex: 1;
    overflow-y: auto;    
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    overflow-x: hidden; /* Avoid horizontal scroll */
}

.channel-list::-webkit-scrollbar {
    width: 6px;
}

.channel-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

body.light .channel-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
}

.channel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px;
    background: rgba(0,0,0,0.11);
    overflow: hidden;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    text-align: left;
    border-radius: 12px;
    transition: all 0.2s;
}

.channel-item:hover {
    background: rgba(37, 99, 235, 0.1);
    color: #fff;
}

body.light .channel-item {
    color: #475569;
}

body.light .channel-item:hover {
    background: #f1f5f9;
    color: #2563eb;
}

.channel-item.active {
    background: #2563eb;
    color: #fff;
}

.channel-item img {
    width: 44px;
    height: 44px;
    object-fit: cover;
    border-radius: 8px;
    background: #232532;
    flex-shrink: 0;
}

.group-tabs {
    display: flex;
    gap: 8px;
    padding: 15px;
    background: rgba(0,0,0,0.1);
    flex-wrap: wrap;
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.group-tabs::-webkit-scrollbar {
    width: 4px;
}
.group-tabs::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
}

body.light .group-tabs {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
}

.group-tab {
    white-space: nowrap;
    padding: 8px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: #fff;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.group-tab:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
    transform: translateY(-1px);
}

.group-tab.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.ch-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.ch-name {
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ch-group {
    font-size: 0.75rem;
    color: #888;
}

body.light .group-tab {
    background: #f1f5f9;
    color: #64748b;
    border-color: #e2e8f0;
}

.sidebar-footer {
    padding: 10px;
    font-size: 0.8rem;
    color: #888;
    text-align: center;
	text-decoration: none;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.localtime-bar {
    position: fixed;
    top: 20px;
    right: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    z-index: 2147483647; /* Maximum z-index to stay above full-screen video */
    transition: opacity 0.3s ease;
}

#status {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 2000;
}

.player-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 20px 40px;
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 2001;
}

.player-notification.show {
    opacity: 1;
}

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
    }
}
