:root {
    --bg-dark: #0b0f19;
    --bg-panel: rgba(17, 24, 39, 0.7);
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.5);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    overflow: hidden;
    background: radial-gradient(circle at top left, #1e1b4b, #0b0f19);
}

#app {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-panel);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.logo {
    padding: 0 24px 20px;
    border-bottom: 1px solid var(--border);
}

.logo h1 {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #a5b4fc, #6366f1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo span {
    font-weight: 300;
    color: var(--text-main);
    -webkit-text-fill-color: var(--text-main);
}

.search-bar {
    padding: 20px 24px;
}

.search-bar input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.3s;
}

.search-bar input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.category-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
    padding: 0 12px;
}

.category-list::-webkit-scrollbar {
    width: 6px;
}
.category-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.category-item {
    padding: 12px 16px;
    margin-bottom: 4px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 400;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.category-item:hover, .category-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: white;
}

.category-item.active {
    border-left: 4px solid var(--primary);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-bar {
    padding: 30px 40px;
}

.top-bar h2 {
    font-size: 32px;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.channel-grid {
    padding: 0 40px 40px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
    flex: 1;
}

.channel-grid::-webkit-scrollbar {
    width: 8px;
}
.channel-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.channel-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    aspect-ratio: 1;
}

.channel-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--primary-glow);
    border-color: rgba(99, 102, 241, 0.4);
}

.channel-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 16px;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}

.channel-name {
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.video-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    width: 90%;
    max-width: 1000px;
    background: #0f172a;
    border-radius: 20px;
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.video-modal.hidden .modal-content {
    transform: scale(0.95);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 32px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.close-btn:hover {
    color: white;
}

.modal-content h2 {
    margin-bottom: 20px;
    padding-right: 40px;
}

.video-container {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

#videoPlayer {
    width: 100%;
    height: 100%;
}

/* Fallback image when logo fails */
.no-logo {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #334155, #1e293b);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: #94a3b8;
    margin-bottom: 16px;
}
