* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #3498db;
    --text-color: #ecf0f1;
    --border-color: #7f8c8d;
    --overlay-bg: rgba(0, 0, 0, 0.8);
    --sidebar-width: 350px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #000;
    color: var(--text-color);
    overflow: hidden;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

.container {
    display: flex;
    height: 100vh;
    width: 100vw;
    position: relative;
}

/* Video Container */
.video-container {
    flex: 1;
    position: relative;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#videoPlayer {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--overlay-bg);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 100;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-overlay p {
    margin-top: 20px;
    font-size: 16px;
    color: var(--text-color);
}

/* Channel Info Overlay */
.channel-info {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--overlay-bg);
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 50;
}

.channel-info.visible {
    opacity: 1;
}

.channel-info img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 5px;
}

.channel-info span {
    font-size: 18px;
    font-weight: 500;
}

/* Menu Toggle Button */
.menu-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--overlay-bg);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 50;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: var(--accent-color);
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

/* Channel List Sidebar */
.channel-list {
    position: absolute;
    right: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--primary-color);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
}

.channel-list.active {
    transform: translateX(0);
}

.channel-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 2px solid var(--border-color);
    background: var(--secondary-color);
}

.channel-list-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--accent-color);
}

.channel-list-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

/* Channel Item */
.channel-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    background: var(--secondary-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.channel-item:hover {
    background: var(--accent-color);
    transform: translateX(-5px);
}

.channel-item.active {
    border-color: var(--accent-color);
    background: var(--accent-color);
}

.channel-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px;
}

.channel-item .channel-name {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}

/* Scrollbar Styling */
.channel-list-content::-webkit-scrollbar {
    width: 8px;
}

.channel-list-content::-webkit-scrollbar-track {
    background: var(--primary-color);
}

.channel-list-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.channel-list-content::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Error Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--secondary-color);
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    color: #e74c3c;
    margin-bottom: 15px;
    font-size: 24px;
}

.modal-content p {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.5;
}

.modal-content button {
    background: var(--accent-color);
    color: var(--text-color);
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.modal-content button:hover {
    background: #2980b9;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .channel-list {
        width: 100%;
        max-width: 100%;
    }
    
    .channel-info {
        top: 10px;
        left: 10px;
        padding: 10px 15px;
    }
    
    .channel-info img {
        width: 30px;
        height: 30px;
    }
    
    .channel-info span {
        font-size: 14px;
    }
    
    .menu-toggle {
        top: 10px;
        right: 10px;
        width: 45px;
        height: 45px;
    }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .channel-list {
        width: 300px;
    }
    
    .channel-info {
        padding: 8px 12px;
    }
    
    .channel-info img {
        width: 25px;
        height: 25px;
    }
    
    .channel-info span {
        font-size: 12px;
    }
}

/* Touch Feedback */
@media (hover: none) {
    .channel-item:active {
        transform: scale(0.98);
    }
    
    .menu-toggle:active {
        transform: scale(0.95);
    }
}

