:root {
    /* Light & Cool Theme Variables based on UI Kit */
    --bg-main: #F4F7FF;         /* Very light periwinkle/grey background */
    --bg-card: #FFFFFF;         /* Pure white for cards */
    --bg-hover: #F0F3FA;        /* Subtle hover state */
    --primary: #859BFF;         /* Soft Blue / Periwinkle Accent */
    --primary-hover: #7188F0;
    --accent: #FF8BA7;          /* Soft pink/coral for secondary accents (like live badges) */
    
    --text-main: #2C303E;       /* Dark Navy/Charcoal for primary text */
    --text-muted: #8E94A8;      /* Soft grey for secondary text */
    
    --shadow-soft: 0 12px 32px rgba(133, 155, 255, 0.1);
    --shadow-card: 0 8px 24px rgba(44, 48, 62, 0.04);
    
    --border-radius-lg: 24px;
    --border-radius-md: 16px;
    --border-radius-sm: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #D5DBEB;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

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

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    padding: 32px 0;
    flex-shrink: 0;
    box-shadow: 4px 0 24px rgba(133, 155, 255, 0.05);
    z-index: 50;
}

.logo-area {
    padding: 0 32px 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
}

.logo-area i {
    color: var(--primary);
    font-size: 28px;
}

.logo-area span {
    color: var(--primary);
}

.category-nav {
    padding: 0 16px;
}

.category-nav h3 {
    padding: 0 16px 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 600;
}

.category-nav ul {
    list-style: none;
}

.category-nav li {
    padding: 16px 20px;
    margin-bottom: 8px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 16px;
}

.category-nav li i {
    font-size: 20px;
}

.category-nav li:hover {
    background: var(--bg-hover);
    color: var(--primary);
}

.category-nav li.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-soft);
    font-weight: 600;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
}

/* Header */
.top-header {
    height: 90px;
    padding: 0 48px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(244, 247, 255, 0.85);
    backdrop-filter: blur(16px);
    z-index: 100;
}

.search-bar {
    position: relative;
    width: 450px;
}

.search-bar i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}

.search-bar input {
    width: 100%;
    background: var(--bg-card);
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 16px 20px 16px 52px;
    color: var(--text-main);
    font-size: 15px;
    font-weight: 500;
    outline: none;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.search-bar input::placeholder {
    color: #A9B0C4;
}

.search-bar input:focus {
    box-shadow: var(--shadow-soft);
}

.user-profile img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-card);
    border: 2px solid #fff;
    transition: transform 0.3s;
}

.user-profile img:hover {
    transform: scale(1.05);
}

/* Player Section */
.player-section {
    padding: 24px 48px 32px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    padding-top: 42.1875%; /* 21:9 ratio for a cinematic web player look */
    background: #000;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

@media (max-width: 1200px) {
    .video-wrapper {
        padding-top: 56.25%; /* 16:9 ratio */
    }
}

video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Prevent cropping on stream */
}

.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(133, 155, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    z-index: 10;
    color: white;
}

.player-overlay i {
    font-size: 64px;
    color: white;
}

.player-overlay p {
    font-size: 18px;
    font-weight: 500;
}

.current-channel-info {
    margin-top: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-card);
    padding: 20px 24px;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-card);
}

.current-channel-info img {
    width: 56px;
    height: 56px;
    border-radius: var(--border-radius-sm);
    object-fit: contain;
    background: var(--bg-main);
    padding: 8px;
}

.current-channel-info h2 {
    font-size: 24px;
    color: var(--text-main);
    margin-bottom: 4px;
    font-weight: 700;
}

.current-channel-info p {
    color: var(--accent);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Channels Section */
.channels-section {
    padding: 0 48px 48px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-main);
}

.section-header span {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
}

.channel-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: var(--shadow-card);
    border: 2px solid transparent;
}

.channel-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-soft);
}

.channel-logo-wrapper {
    width: 88px;
    height: 88px;
    background: var(--bg-main);
    border-radius: 50%;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    transition: transform 0.3s ease;
}

.channel-card:hover .channel-logo-wrapper {
    transform: scale(1.05);
}

.channel-logo-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.channel-name {
    font-weight: 700;
    font-size: 17px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.channel-category {
    font-size: 12px;
    color: var(--primary);
    background: rgba(133, 155, 255, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 600;
}

/* Playing Indicator */
.channel-card.playing {
    border-color: var(--primary);
    box-shadow: var(--shadow-soft);
}

.channel-card.playing .channel-category {
    background: var(--accent);
    color: white;
}

.channel-card.playing .channel-category::before {
    content: "• ";
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 0;
    color: var(--primary);
    font-size: 20px;
    font-weight: 600;
}

.loading-spinner i {
    margin-right: 12px;
}
