/* style.css */
:root {
    --bg-main: #0f0f11;
    --bg-sidebar: #18181c;
    --bg-hover: #232329;
    --bg-active: #e50914; /* Red accent */
    --text-main: #ffffff;
    --text-muted: #a1a1aa;
    --border-color: #27272a;
    --sidebar-width: 300px;
    --transition-speed: 0.2s;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    overflow: hidden; /* Prevent body scroll */
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
    z-index: 10;
    transition: transform var(--transition-speed) ease;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.loading {
    padding: 20px;
    text-align: center;
    color: var(--text-muted);
}

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

/* Custom Scrollbar */
.channel-list::-webkit-scrollbar {
    width: 6px;
}

.channel-list::-webkit-scrollbar-track {
    background: transparent;
}

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

/* Channel Groups */
.channel-group {
    margin-bottom: 15px;
}

.group-title {
    padding: 10px 20px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Channel Item */
.channel-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
    text-decoration: none;
    color: var(--text-main);
    border-left: 3px solid transparent;
}

.channel-item:hover {
    background-color: var(--bg-hover);
}

.channel-item.active {
    background-color: var(--bg-hover);
    border-left-color: var(--bg-active);
}

.channel-logo {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-color: var(--border-color);
    margin-right: 15px;
    object-fit: contain;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    overflow: hidden;
}

.channel-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.channel-info {
    flex: 1;
}

.channel-name {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #000; /* Black for video area */
    position: relative;
    height: 100%;
}

.video-container {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

/* Ensure Plyr takes full height */
.plyr {
    height: 100%;
    width: 100%;
}

.now-playing {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 5;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 1rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-speed) ease;
}

.video-container:hover .now-playing,
.plyr--paused .now-playing {
    opacity: 1;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        width: 80%;
        max-width: 320px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.5);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-toggle {
        display: block;
    }
    
    /* We need a toggle button on the main content when sidebar is closed */
    .mobile-nav-toggle {
        position: absolute;
        top: 20px;
        left: 20px;
        z-index: 20;
        background: rgba(0,0,0,0.5);
        border: none;
        color: white;
        padding: 10px;
        border-radius: 4px;
        cursor: pointer;
        display: block;
    }

    /* Hide the built-in mobile toggle if we are outside */
}

/* Hidden elements */
.hidden {
    display: none !important;
}
