/* assets/css/style.css */
:root {
    --bg-dark: #0b1220;
    --card-bg: #111827;
    --border-color: #1f2937;
    --primary: #2563eb;
    --accent: #3b82f6;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --danger: #ef4444;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

/* --- Navbar --- */
.navbar {
    background: rgba(11, 18, 32, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    padding: 0.8rem 1rem;
    z-index: 1000;
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.brand-text {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
}

/* --- Search --- */
.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 15px;
}
.search-wrapper input {
    width: 100%;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: white;
    padding: 8px 12px 8px 35px;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}
.search-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
    outline: none;
}
.search-wrapper svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* --- Layout --- */
.main-wrapper {
    margin-top: 80px; /* Offset for fixed header */
    padding-bottom: 40px;
}

/* --- Video Card --- */
.video-card {
    background: black;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}
.video-info {
    padding: 1.2rem;
    background: var(--card-bg);
}
.video-info h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* --- Categories --- */
.category-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: none; /* Firefox */
}
.category-scroll::-webkit-scrollbar { display: none; } /* Chrome */

.cat-pill {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 20px;
    border-radius: 50px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    font-weight: 500;
}
.cat-pill:hover, .cat-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* --- Channel Grid --- */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.channel-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.channel-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: var(--primary);
}

.channel-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
    padding: 8px;
}

.channel-name {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.channel-cat {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.live-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--danger);
    animation: pulse 2s infinite;
}

/* --- Chat --- */
.chat-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
}
.chat-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}
.chat-body {
    flex-grow: 1;
    overflow-y: auto;
}

/* --- Mobile Optimizations (The Critical Part) --- */
@media (max-width: 768px) {
    .main-wrapper {
        margin-top: 60px;
        padding-left: 10px;
        padding-right: 10px;
    }
    
    /* Sticky Player on Mobile */
    .player-container-wrapper {
        position: sticky;
        top: 60px; /* Height of navbar */
        z-index: 99;
        margin-left: -10px;
        margin-right: -10px;
    }
    
    .video-card {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    
    .video-info {
        padding: 0.8rem 1rem;
    }

    /* Grid becomes 2 columns */
    .channel-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }

    .channel-card {
        padding: 0.8rem;
    }
    
    .channel-logo {
        width: 45px;
        height: 45px;
    }

    .search-wrapper {
        max-width: 150px; /* Shrink search on mobile nav */
    }
    
    .chat-card.mobile-chat-height {
        height: 300px;
    }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}