/**
 * StreamMK Main Stylesheet
 * Mobile-first responsive design
 */

:root {
    --primary-color: #0a0a0a;
    --secondary-color: #1a1a1a;
    --accent-color: #ff6b35;
    --text-color: #ffffff;
    --text-muted: #b0b0b0;
    --border-color: #2a2a2a;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
    --gradient-primary: linear-gradient(135deg, #ff6b35 0%, #f44336 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    overflow-y: auto; /* Enable full page scroll */
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    width: 100%;
    align-items: center; /* Center horizontally */
    position: relative;
    overflow-y: auto; /* Enable full page scroll */
    overflow-x: hidden;
}

/* Background Video Container */
.bg-video-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.bg-video-container video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    align-items: center; /* Center horizontally */
    overflow-y: auto; /* Make entire page scrollable */
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content horizontally */
}

@media (min-width: 769px) {
    .container {
        padding: 0 3rem;
    }
    
    .main-content {
        padding-top: 80px !important; /* Space for fixed header on desktop */
        padding-bottom: 100px !important; /* Space for fixed footer on desktop */
        min-height: calc(100vh - 180px);
    }
}

/* Responsive scaling for different screen sizes */
@media (min-width: 1920px) {
    .main-content {
        transform: scale(1);
        transform-origin: top center;
    }
}

@media (min-width: 1400px) and (max-width: 1919px) {
    .main-content {
        transform: scale(1);
        transform-origin: top center;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    .main-content {
        transform: scale(0.95);
        transform-origin: top center;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .main-content {
        transform: scale(0.9);
        transform-origin: top center;
    }
}

@media (min-width: 769px) and (max-width: 991px) {
    .main-content {
        transform: scale(0.85);
        transform-origin: top center;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0;
    }
}

/* Header */
.main-header {
    background-color: var(--secondary-color);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0;
}

.main-header .container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    width: 100%;
    flex-wrap: wrap;
}

.logo {
    order: 1;
    flex-shrink: 0;
    margin-right: auto;
}

/* Main Menu - Always after logo, before search */
.main-menu {
    order: 2;
    margin-left: 2rem;
    margin-right: auto;
}

.search-wrapper {
    order: 3;
    margin-left: auto;
    flex-shrink: 0;
}

.logo h1,
.logo .logo-text {
    font-size: 1.5rem;
    color: var(--accent-color);
    margin: 0;
    font-weight: 600;
}

.logo .logo-image {
    max-height: 45px;
    max-width: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

@media (max-width: 768px) {
    .logo .logo-image {
        max-height: 35px;
        max-width: 150px;
    }
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    height: 100%;
}

/* Main Menu */
.main-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.main-menu .menu-link {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0;
    transition: color 0.2s;
    position: relative;
}

.main-menu .menu-link.is-active {
    color: var(--accent-color);
}

/* Font sizes */
.menu-link-small {
    font-size: 0.85rem;
}

.menu-link-medium {
    font-size: 0.95rem;
}

.menu-link-large {
    font-size: 1.1rem;
}

/* Text cases */
.menu-link-uppercase {
    text-transform: uppercase;
}

.menu-link-lowercase {
    text-transform: lowercase;
}

.menu-link-normal {
    text-transform: none;
}

.main-menu .menu-link:hover {
    color: var(--accent-color);
}

.main-menu .menu-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s;
}

.main-menu .menu-link.is-active::after {
    width: 100%;
}

.main-menu .menu-link:hover::after {
    width: 100%;
}

/* Mobile Hamburger Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    order: 0;
    margin-right: 1rem;
}

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

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

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

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

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1998;
    opacity: 0;
    transition: opacity 0.3s;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

/* Mobile Slide Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    max-width: 85%;
    height: 100%;
    background-color: var(--secondary-color);
    z-index: 1999;
    transition: left 0.3s ease-in-out;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.mobile-menu.active {
    left: 0;
}

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

.mobile-menu-header h2,
.mobile-menu-logo-text {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin: 0;
    font-weight: 600;
}

.mobile-menu-logo-image {
    max-height: 40px;
    max-width: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.mobile-menu-close {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

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

.mobile-menu-content {
    padding: 1rem 0;
}

.mobile-menu-link {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s, color 0.2s;
}

.mobile-menu-link:hover {
    background-color: var(--primary-color);
    color: var(--accent-color);
}

.mobile-menu-home {
    font-weight: 600;
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
}

.mobile-menu-link-small {
    font-size: 0.9rem;
}

.mobile-menu-link-medium {
    font-size: 1rem;
}

.mobile-menu-link-large {
    font-size: 1.1rem;
}

.mobile-menu-link-uppercase {
    text-transform: uppercase;
}

.mobile-menu-link-lowercase {
    text-transform: lowercase;
}

.mobile-menu-link-normal {
    text-transform: none;
}

.mobile-menu-link.is-active {
    background: var(--accent-color);
    color: #fff !important;
}

@media (max-width: 768px) {
    .main-menu {
        display: none; /* Hide desktop menu on mobile */
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .logo {
        order: 1;
    }
    
    .search-wrapper {
        order: 2;
    }
}

/* Page Content Styles */
.page-content {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--secondary-color);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.page-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.page-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-style: italic;
}

.page-body {
    line-height: 1.8;
    color: var(--text-color);
}

.page-body h1,
.page-body h2,
.page-body h3,
.page-body h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.page-body p {
    margin-bottom: 1rem;
}

.page-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.page-body a {
    color: var(--accent-color);
    text-decoration: none;
}

.page-body a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .page-content {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
}

/* Search Wrapper */
.search-wrapper {
    position: relative;
}

.search-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.search-icon-btn:hover {
    background: var(--primary-color);
}

.search-icon-btn svg {
    width: 24px;
    height: 24px;
}

/* Search overlay backdrop */
.search-overlay-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.search-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    z-index: 2000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    width: 90%;
    max-width: 500px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.3s;
}

.search-box.active {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.search-box.active #searchInput {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.2);
}

.search-box .search-close-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem 0.5rem;
    line-height: 1;
}

#searchInput {
    width: 100%;
    padding: 0.75rem 2rem 0.75rem 1rem;
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
}

#searchInput {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
}

#searchInput:focus {
    border-color: var(--accent-color);
}

.search-results {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 2001;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: background-color 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: var(--primary-color);
}

.search-result-item img,
.search-result-item .channel-icon-placeholder {
    width: 40px;
    height: 40px;
    min-width: 40px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.search-result-item .channel-icon-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    font-size: 1.25rem;
}

.search-result-item > div {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.search-result-item strong {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-item > div > div {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Default Player (when no channel selected) */
/* Video wrapper with default player - 16:9 aspect ratio */
.video-wrapper #defaultPlayerContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-bottom: 0 !important;
    margin: 0 !important;
}

.default-player {
    position: relative;
    width: 100%;
    height: 480px; /* Fixed height instead of 100% */
    background: #000;
    background-image: url('/assets/images/default-poster.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    border-radius: 16px;
}

@media (max-width: 768px) {
    .default-player {
        height: 240px; /* Smaller height on mobile */
    }
}

.default-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

/* Show poster as background when video is not loaded or fails */
.default-player video:not([src]),
.default-player video[poster] {
    background-image: url('/assets/images/default-poster.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.default-player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    text-align: center;
    padding: 2rem;
}

.default-player-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 1rem 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

.default-player-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 1.2rem;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

@media (max-width: 768px) {
    .default-player-title {
        font-size: 1.8rem;
    }
    
    .default-player-subtitle {
        font-size: 1rem;
    }
}

/* Custom Player Controls */
.custom-player-controls {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s;
}

.video-wrapper:hover .custom-player-controls {
    opacity: 1;
}

.custom-player-controls button {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s;
}

.custom-player-controls button:hover {
    transform: scale(1.1);
}

/* Play/Pause Overlay Button */
.play-pause-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    font-size: 60px;
    cursor: pointer;
    padding: 20px 30px;
    border-radius: 50%;
    z-index: 20;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    opacity: 0;
    pointer-events: auto;
}

.play-pause-overlay:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-wrapper:hover .play-pause-overlay {
    opacity: 1;
}

/* Show overlay when video is paused */
.video-wrapper video[data-paused="true"] ~ .play-pause-overlay,
.video-wrapper:hover .play-pause-overlay {
    opacity: 1;
}

@media (max-width: 768px) {
    .play-pause-overlay {
        font-size: 50px;
        width: 80px;
        height: 80px;
        opacity: 1;
    }
    
    .custom-player-controls {
        opacity: 1;
    }
}

/* Stream Selector */
.stream-selector-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

@media (min-width: 769px) {
    .player-info-desktop {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 2px solid var(--border-color);
        width: 100%;
    }
    
    .stream-selector-container {
        order: 2;
        margin-top: 0;
        margin-left: auto;
    }
    
    .player-info-left {
        order: 1;
    }
}

.stream-selector-container span {
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.stream-selector-btn {
    padding: 0.5rem 1rem;
    background: var(--secondary-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.stream-selector-btn:hover {
    background: var(--primary-color);
    border-color: var(--accent-color);
}

.stream-selector-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

@media (max-width: 768px) {
    .stream-selector-container {
        justify-content: center;
    }
    
    .custom-player-controls {
        opacity: 1; /* Always visible on mobile */
    }
}

.main-nav {
    display: flex;
    gap: 1rem;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
    font-size: 0.875rem;
}

.main-nav a:hover {
    background-color: var(--primary-color);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 0 !important;
    width: 100%;
    max-width: 1400px;
    margin: 50px auto 0;
    display: flex;
    flex-direction: column;
    align-items: center; /* Center content horizontally */
    /* Add padding for fixed header and footer */
    padding-top: 80px !important; /* Space for fixed header */
    padding-bottom: 100px !important; /* Space for fixed footer */
    min-height: calc(100vh - 180px); /* Full height minus header and footer */
    box-sizing: border-box;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    padding: 10px;
}

/* Hide mobile player info on desktop - Global rule */
@media (min-width: 769px) {
    .player-info-mobile,
    .player-info-mobile *,
    .channel-name-mobile,
    .channel-name-mobile *,
    .channel-title-mobile {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        opacity: 0 !important;
        position: absolute !important;
        left: -9999px !important;
    }
    
    /* Force video-wrapper to be full width in player-section - OVERRIDE ALL */
    .player-section .video-wrapper,
    .player-container .video-wrapper,
    .player-section .video-wrapper,
    .main-content .player-section .video-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* Player Section */
.player-section {
    margin-bottom: 3rem;
    width: 100%;
    max-width: 100%;
    position: relative; /* Relative for full page scroll */
    z-index: 50; /* Lower than sticky elements but higher than ads */
    background-color: transparent;
    padding-top: 1rem;
}

@media (min-width: 769px) {
    .player-section {
        margin-bottom: 4rem;
    }
}

.player-container {
    background-color: var(--secondary-color);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 1400px;
    width: 100%;
    margin: 2rem auto;
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: relative;
    z-index: 60; /* Higher than ads but lower than sticky elements */
}

/* Ensure video-wrapper is full width in player-container */
.player-container .video-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

@media (min-width: 769px) {
    .player-container {
        padding: 2.5rem;
        margin: 3rem auto;
        max-width: 1400px;
    }
    
    .player-container:hover {
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
        transform: translateY(-6px);
    }
}

/* Player Info (Desktop - below player) */
.player-info-desktop {
    display: none;
}

@media (min-width: 769px) {
    .player-info-desktop {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 2px solid var(--border-color);
        width: 100%;
    }
    
    .player-info-left {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex: 1;
        order: 1;
    }
    
    .player-info-right {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 0.75rem;
        flex-shrink: 0;
        order: 2;
    }
    
    .player-info-icon,
    .player-info-icon-placeholder {
        display: none;
    }
    
    .player-info-text {
        flex: 1;
    }
    
    .player-info-title {
        font-size: 1.5rem;
        margin: 0 0 0.25rem 0;
        color: var(--text-color);
        font-weight: 600;
    }
    
    .player-info-category-small {
        font-size: 0.85rem;
        color: var(--text-muted);
        margin-top: 0.25rem;
    }
    
    .player-info-meta {
        display: flex;
        align-items: center;
        gap: 1rem;
        flex-wrap: wrap;
    }
    
    .live-badge-info {
        background: linear-gradient(135deg, #ff6b35 0%, #f44336 100%);
        color: #fff;
        padding: 0.3rem 0.7rem;
        border-radius: 6px;
        font-size: 0.8rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    }
    
    .player-info-category,
    .player-info-type {
        color: var(--text-muted);
        font-size: 0.9rem;
    }
    
    .player-info-right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.75rem;
        flex-shrink: 0;
    }
    
    .player-info-visits {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        color: var(--text-muted);
        font-size: 0.9rem;
    }
    
    .player-info-visits .visits-count {
        font-weight: 600;
        color: var(--accent-color);
    }
    
    .player-info-actions {
        display: flex;
        gap: 0.5rem;
    }
}

/* Mobile styles for player-info-right */
@media (max-width: 768px) {
    .player-info-right {
        margin-top: 1rem;
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.75rem;
    }
    
    .player-info-actions {
        display: flex;
        gap: 0.5rem;
    }
}

.report-channel-btn {
    border: 1px solid var(--accent-color);
    background: transparent;
    color: var(--accent-color);
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.report-channel-btn:hover {
    background: var(--accent-color);
    color: #fff;
}

.report-channel-btn:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Player Header - Hidden everywhere */
.player-header {
    display: none !important;
}

.player-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.player-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--primary-color);
    flex-shrink: 0;
}

.player-header-icon-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.live-badge-header {
    background: linear-gradient(135deg, #ff6b35 0%, #f44336 100%);
    color: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.player-header-right {
    flex: 1;
    text-align: right;
    min-width: 0;
}

.player-title {
    font-size: 1.5rem;
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-container h2 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.live-badge {
    background-color: var(--danger-color);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: bold;
}

.video-wrapper {
    position: relative;
    width: 100% !important;
    max-width: 100% !important;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin-bottom: 2rem;
    overflow: hidden;
    background: #000;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7);
    height: 0; /* Ensure 16:9 aspect ratio */
}

/* Ensure video-wrapper with default player maintains 16:9 */
.video-wrapper #defaultPlayerContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding-bottom: 0 !important;
}

@media (min-width: 769px) {
    .video-wrapper {
        border-radius: 20px;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.8);
    }
}

.video-wrapper #streamPlayer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
}

/* Ensure video-wrapper is full width within player-section */
.player-section .video-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Ensure streamPlayer has max-width within player-section */
.player-section #streamPlayer,
.player-section .video-wrapper #streamPlayer {
    max-width: 100% !important;
    width: 100% !important;
}

.video-wrapper #streamPlayer video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
}

/* JW Player specific styles */
.video-wrapper .jwplayer {
    width: 100% !important;
    height: 100% !important;
}

.video-wrapper .jw-media {
    width: 100% !important;
    height: 100% !important;
}

/* Mobile Full Width Styles */
@media (max-width: 768px) {
    .main-header {
        padding: 0.75rem 0;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0 1rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .main-nav {
        display: none;
    }
    
    .search-box {
        width: calc(100vw - 2rem);
        max-width: 400px;
        right: -1rem;
    }
    
    .main-content {
        padding-top: 70px !important; /* Space for fixed header on mobile */
        padding-bottom: 80px !important; /* Space for fixed footer on mobile */
        min-height: calc(100vh - 150px);
        overflow-y: auto; /* Make content scrollable on mobile */
        overflow-x: hidden;
    }
    
    .player-section {
        position: relative; /* Changed from sticky to relative for full page scroll */
        z-index: 100;
        background-color: transparent;
        padding-top: 0.5rem;
    }
    
    .container {
        padding: 0;
        max-width: 100%;
    }
    
    .player-section {
        margin: 0;
        margin-bottom: 0;
        width: 100%;
        padding: 0;
    }
    
    .player-container {
        padding: 0 !important;
        border-radius: 0;
        background-color: transparent;
        box-shadow: none;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    /* Hide player header and ad on mobile */
    .player-header {
        display: none !important;
    }
    
    .ad-container.ad-player {
        display: none !important;
    }
    
    /* Channel info below player on mobile */
    .player-info-mobile {
        padding: 1rem;
        background: var(--secondary-color);
        border-top: 1px solid var(--border-color);
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-top: 0;
        gap: 1rem;
    }
    
    .player-info-mobile-left {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .player-info-mobile-title {
        font-size: 1.25rem;
        margin: 0;
        color: var(--text-color);
        font-weight: 600;
    }
    
    .player-info-mobile-category {
        font-size: 0.85rem;
        color: var(--text-muted);
    }
    
    .player-info-mobile-right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    .player-info-mobile-stats {
        display: flex;
        align-items: center;
        gap: 0.25rem;
        color: var(--text-muted);
        font-size: 0.9rem;
    }
    
    .player-info-mobile-stats .visits-count {
        font-weight: 600;
        color: var(--accent-color);
    }
    
    .player-info-mobile-actions {
        display: flex;
        gap: 0.5rem;
    }
    
    /* Hide channel name mobile on desktop - must be outside mobile query */
    
    .player-header-icon,
    .player-header-icon-placeholder {
        width: 36px;
        height: 36px;
    }
    
    .live-badge-header {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .player-title {
        font-size: 1.1rem;
    }
    
    .video-wrapper {
        position: relative;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        padding-bottom: 56.25% !important; /* 16:9 aspect ratio */
        height: 0 !important;
        border-radius: 0 !important;
        background: #000;
        overflow: hidden;
    }
    
    .video-wrapper #streamPlayer {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
    }
    
    .video-wrapper #streamPlayer video {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    /* Ensure full width player on mobile - remove all padding */
    .player-section,
    .player-section .container,
    .player-container,
    .video-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .main-content .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    .channel-info {
        padding: 1rem;
        background: var(--secondary-color);
        margin-top: 0;
        border-top: 1px solid var(--border-color);
    }
    
    .player-container h2 {
        padding: 0;
        margin-bottom: 0.5rem;
        font-size: 1.25rem;
    }
    
    .live-badge {
        margin-left: 15px;
    }
    
    .video-wrapper {
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 0;
        padding-bottom: 56.25%;
        width: 100%;
    }
    
    .channel-info {
        padding: 1rem 15px;
        margin-top: 0;
    }
    
    /* Full width player on mobile */
    .player-section.fullscreen-mobile {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9999;
        background: #000;
        margin: 0;
        width: 100%;
    }
    
    .player-section.fullscreen-mobile .player-container {
        height: 100vh;
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .player-section.fullscreen-mobile .video-wrapper {
        flex: 1;
        height: 100%;
        padding-bottom: 0;
    }
    
    .player-section.fullscreen-mobile .channel-info {
        display: none;
    }
}

.channel-info {
    display: none; /* Hidden, info is in player-info-desktop */
}

/* Channels Grid - 3 columns */
.channels-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0.5rem !important;
    margin-bottom: 2rem;
    grid-auto-flow: row;
    padding: 10px;
}

/* Ensure grid layout is preserved even when cards are hidden */
.channels-grid .channel-card:not(.category-hidden) {
    display: block;
}

@media (min-width: 768px) {
    .channels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}

@media (min-width: 1024px) {
    .channels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}

.channel-card {
    padding: 0;
    background: transparent;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.channel-card.hidden,
.channel-card.category-hidden {
    display: none !important;
    visibility: hidden !important;
}

/* Ensure channel card link styles are preserved */
.channel-card:not(.category-hidden) .channel-card-link {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-decoration: none !important;
    color: inherit !important;
}

.channel-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-color 0.2s ease, transform 0.2s ease, background 0.2s ease;
    min-height: 100px;
}

.channel-card.featured .channel-card-link {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.06);
}

.channel-card-link:hover {
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-2px);
}

.channel-card-link.active {
    border-color: #2196F3;
    background: rgba(33, 150, 243, 0.1);
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.channel-card-link.active .channel-card-label {
    color: #2196F3;
}

.channel-icon-shell {
    width: 56px;
    height: 56px;
    border-radius: 1rem;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0.25rem;
}

.channel-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.channel-icon-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-muted);
}

.channel-card-label {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channels-grid.list-view {
    display: flex !important;
    flex-direction: column;
    grid-template-columns: none;
    gap: 0.25rem !important;
    padding: 5px !important;
}

.channels-grid.list-view .channel-card {
    margin: 0;
    padding: 0;
}

.channels-grid.list-view .channel-card-link {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    min-height: 48px !important;
    height: 48px !important;
    max-height: 48px !important;
    gap: 0.75rem !important;
    padding: 0.5rem 0.75rem !important;
    margin: 0 !important;
}

.channels-grid.list-view .channel-icon-shell {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    max-width: 40px !important;
    max-height: 40px !important;
    border-radius: 0.5rem !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

.channels-grid.list-view .channel-icon {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.channels-grid.list-view .channel-icon-placeholder {
    font-size: 1.2rem !important;
}

.channels-grid.list-view .channel-card-label {
    font-size: 0.9rem !important;
    letter-spacing: 0.02em !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1 !important;
    text-align: left !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.report-channel-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.report-channel-modal.active {
    display: flex;
}

.report-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(3px);
}

.report-modal-content {
    position: relative;
    background: #0d0d0f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 2rem;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    z-index: 1;
}

.report-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.report-modal-content h3 {
    margin: 0 0 0.5rem 0;
    color: #fff;
}

.report-modal-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.report-label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#reportChannelForm select,
#reportChannelForm textarea,
#reportChannelForm input[type="text"] {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--primary-color);
    color: var(--text-color);
    padding: 0.65rem 0.85rem;
    margin-bottom: 1rem;
    font-family: inherit;
}

#reportChannelForm select option {
    background: var(--primary-color);
    color: var(--text-color);
}

#reportChannelForm textarea {
    resize: vertical;
}

.report-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.report-modal-status {
    min-height: 1.2rem;
    font-size: 0.85rem;
    color: var(--accent-color);
}

.report-modal-status.error {
    color: #ff6b6b;
}

.btn-outline,
.btn-primary {
    border-radius: 999px;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    border: 1px solid transparent;
    background: none;
    transition: all 0.2s ease;
}

.btn-outline {
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text-color);
}

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

.btn-primary {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: progress;
}

.report-channel-modal input:focus-visible,
.report-channel-modal select:focus-visible,
.report-channel-modal textarea:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

body.modal-open {
    overflow: hidden;
}

.category-badge {
    display: inline-block;
    background-color: var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    margin-top: 0.25rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

@media (min-width: 480px) {
    .category-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
    }
}

/* Categories Filter */
.categories-section {
    margin-bottom: 2rem;
    padding: 10px;
}

/* Categories - Mobile only (below channels) */
.categories-mobile {
    display: block;
}

.categories-desktop {
    display: none;
}

@media (min-width: 769px) {
    .categories-mobile {
        display: none;
    }
    
    .categories-desktop {
        display: block;
    }
}

/* Channels Toolbar */
.channels-toolbar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: transparent;
}

.channels-view-toggle {
    display: flex;
    gap: 0.5rem;
    background: transparent;
    padding: 0.25rem;
    border-radius: 8px;
}

.channels-view-toggle button {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.channels-view-toggle button:hover {
    color: var(--text-color);
    background: var(--secondary-color);
}

.channels-view-toggle button.active {
    background: var(--accent-color);
    color: #fff;
}

@media (max-width: 768px) {
    .channels-toolbar {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .channels-sort {
        justify-content: center;
    }
    
    .channels-view-toggle {
        justify-content: center;
    }
}

/* Desktop Layout: Player left, Categories and Channels right */
@media (min-width: 769px) {
    html, body {
        overflow-y: auto; /* Enable scroll */
        overflow-x: hidden;
        height: auto;
        min-height: 100vh;
    }
    
    #mainContainer {
        display: grid;
        grid-template-columns: 1fr 350px;
        gap: 2rem;
        align-items: start;
        min-height: calc(100vh - 180px); /* Changed from height: 100vh to min-height */
        overflow: visible; /* Changed from hidden to visible for scroll */
    }
    
    .player-section {
        grid-column: 1;
        position: relative; /* Ensure player section doesn't cover ads */
        z-index: 50; /* Higher than ads but lower than sticky elements */
    }
    
    .channels-section {
        grid-column: 2;
        position: sticky;
        top: 100px; /* Below header + ad-header */
        align-self: start;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        padding: 0 20px 20px 20px;
        z-index: 200; /* Higher than player section */
    }
    
    .ad-sidebar {
        position: sticky;
        top: 100px; /* Below header + ad-header */
        align-self: start;
        z-index: 150; /* Between player and channels */
    }
    
    .channels-section::-webkit-scrollbar {
        width: 6px;
    }
    
    .channels-section::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .channels-section::-webkit-scrollbar-thumb {
        background: var(--border-color);
        border-radius: 3px;
    }
    
    .channels-section::-webkit-scrollbar-thumb:hover {
        background: var(--text-muted);
    }
    
    .channels-section .categories-section {
        margin-bottom: 2rem;
    }
    
    .channels-section .section-title {
        margin-top: 0;
        margin-bottom: 1rem;
        font-size: 1.1rem;
        background-color: #161616e3;
        border-radius: 20px;
    }
    
    .channels-section .channels-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
    
    .channels-section .channel-icon-shell {
        width: 56px;
        height: 56px;
    }
    
    .featured-section {
        grid-column: 1 / -1;
    }
}

.categories-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.channels-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.channels-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.channels-sort label {
    font-weight: 600;
    letter-spacing: 0.05em;
}

.channels-sort select {
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 0.1rem 0.5rem;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.channels-sort select option {
    background: var(--primary-color);
    color: var(--text-color);
    padding: 0.5rem;
}

/* General select styling */
select {
    background: var(--primary-color) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color);
}

select option {
    background: var(--primary-color) !important;
    color: var(--text-color) !important;
}

.channels-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: rgba(255, 255, 255, 0.04);
    padding: 0.2rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.channels-view-toggle button {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.channels-view-toggle button.active {
    background: var(--accent-color);
    color: #fff;
}

.channels-view-toggle button:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.category-btn {
    padding: 0.5rem 1rem;
    background-color: var(--secondary-color);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 20px;
    transition: all 0.2s;
    border: 1px solid var(--border-color);
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
}

.category-btn:not(a) {
    text-decoration: none;
    display: inline-block;
}

.category-btn:hover,
.category-btn.active {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

/* Ad Containers */
.ad-container {
    margin: 1rem 0;
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative; /* Ensure ads don't cover content */
    z-index: 10; /* Lower than player (z-index: 100) */
    width: 100%;
    max-width: 100%;
}

.ad-header {
    margin-bottom: 1rem;
    margin-top: 0;
    padding-top: 1rem;
}

.ad-footer {
    margin-top: 2rem;
    margin-bottom: 0;
    padding-bottom: 1rem;
}

.ad-sidebar {
    margin-bottom: 2rem;
    width: 100%;
}

.ad-player-top {
    margin-bottom: 1.5rem;
    margin-top: 0;
    width: 100%;
}

.ad-player-bottom {
    margin-top: 1.5rem;
    margin-bottom: 0;
    width: 100%;
}

.ad-player {
    margin-bottom: 1rem;
    width: 100%;
}

/* PWA Install Prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--secondary-color);
    border-top: 2px solid var(--accent-color);
    padding: 1rem;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    transition: transform 0.3s ease-out, visibility 0.3s ease-out;
    transform: translateY(100%);
    visibility: hidden;
    display: none;
}

@media (max-width: 768px) {
    .pwa-install-prompt {
        display: block;
        padding: 0.75rem;
        transform: translateY(100%);
        visibility: hidden;
    }
    
    .pwa-install-content {
        gap: 0.5rem;
    }
    
    .pwa-install-text strong {
        font-size: 0.9rem;
    }
    
    .pwa-install-text span {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .pwa-install-prompt {
        padding: 0.6rem;
    }
    
    .pwa-install-content {
        gap: 0.4rem;
    }
}

.pwa-install-prompt.active {
    transform: translateY(0);
    visibility: visible;
    display: block;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 100%;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.pwa-install-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .pwa-install-icon {
        font-size: 1.5rem;
    }
}

.pwa-install-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.pwa-install-text strong {
    color: var(--text-color);
    font-size: 1rem;
}

.pwa-install-text span {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.pwa-install-btn {
    background: var(--accent-color);
    color: #fff;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
    font-size: 0.9rem;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .pwa-install-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

.pwa-install-btn:hover {
    background: #e55a2b;
}

.pwa-install-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    flex-shrink: 0;
    line-height: 1;
    min-width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.pwa-install-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.pwa-install-close:hover {
    color: var(--text-color);
}

/* Channel Description */
.channel-description {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: var(--secondary-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 100%;
}

.channel-description-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.channel-description-header h3 {
    font-size: 1.1rem;
    margin: 0;
    color: var(--text-color);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.channel-description-body {
    line-height: 1.8;
    color: var(--text-color);
}

.channel-description p {
    color: var(--text-color);
    line-height: 1.8;
    margin: 0;
    font-size: 1rem;
}

.channel-description-empty .channel-description-body {
    color: var(--text-muted);
    font-style: italic;
}

/* News Section */
.news-section {
    margin-top: 3rem;
    margin-bottom: 4rem;
}

.news-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.news-section .section-title {
    margin-bottom: 0.25rem;
}

.news-section .section-subtitle {
    color: var(--text-muted);
    margin: 0;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: var(--secondary-color);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.news-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.35);
}

.news-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card-media {
    position: relative;
    overflow: hidden;
}

.news-card-media img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.news-card:hover .news-card-media img {
    transform: scale(1.05);
}

.news-card-category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.news-card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.news-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.news-card-excerpt {
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
    font-size: 0.95rem;
}

.news-featured-card {
    display: flex;
    gap: 1.5rem;
    background: var(--secondary-color);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    margin-bottom: 1.75rem;
}

.news-featured-link {
    display: flex;
    gap: 1.5rem;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.news-featured-media {
    position: relative;
    flex: 1;
    min-height: 280px;
}

.news-featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-featured-body {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1rem;
}

.news-featured-body h3 {
    font-size: 1.8rem;
    margin: 0;
    text-transform: uppercase;
}

.news-featured-body p {
    color: var(--text-muted);
    margin: 0;
    line-height: 1.7;
}

.news-grid-compact {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.news-category-section {
    margin-bottom: 3rem;
}

.news-page-featured {
    flex-direction: column;
}

.news-page-featured .news-featured-link {
    flex-direction: column;
}

.news-page-featured .news-featured-media {
    width: 100%;
    min-height: 320px;
}

.news-view-all {
    text-decoration: none;
}

.news-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.news-hero {
    margin-bottom: 1.5rem;
}

.news-hero h1 {
    margin-bottom: 0.5rem;
}

.news-hero p {
    color: var(--text-muted);
    margin: 0;
}

.news-category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.news-category-chip {
    padding: 0.35rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.news-category-chip.active,
.news-category-chip:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.news-page-grid .news-card-media img {
    height: 180px;
}

.news-article {
    background: var(--secondary-color);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-color);
    margin-bottom: 3rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
}

.news-article-hero {
    margin-bottom: 2rem;
}

.news-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.news-article-category {
    color: var(--accent-color);
}

.news-article-title {
    font-size: 2.2rem;
    margin: 1rem 0;
    text-transform: uppercase;
}

.news-article-excerpt {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.news-article-cover img {
    width: 100%;
    border-radius: 12px;
    max-height: 420px;
    object-fit: cover;
}

.news-article-body {
    line-height: 1.9;
}

.news-article-body img {
    max-width: 100%;
    border-radius: 12px;
    margin: 1rem 0;
}

.news-related {
    margin-bottom: 4rem;
}

@media (max-width: 768px) {
    .news-section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .news-card-media img {
        height: 180px;
    }

    .news-article {
        padding: 1.5rem;
    }

    .news-article-title {
        font-size: 1.8rem;
    }

    .news-featured-card,
    .news-featured-link {
        flex-direction: column;
    }

    .news-featured-media {
        min-height: 220px;
    }

    .news-featured-body h3 {
        font-size: 1.4rem;
    }
}

/* Footer */
.main-footer {
    background-color: var(--secondary-color);
    padding: 2rem 0;
    text-align: center;
    margin-top: 100px;
    border-top: 1px solid var(--border-color);
    width: 100%;
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 1;
}

.main-footer .container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.footer-menu-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-menu-link-small {
    font-size: 0.85rem;
}

.footer-menu-link-medium {
    font-size: 0.95rem;
}

.footer-menu-link-large {
    font-size: 1.1rem;
}

.footer-menu-link-uppercase {
    text-transform: uppercase;
}

.footer-menu-link-lowercase {
    text-transform: lowercase;
}

.footer-menu-link-normal {
    text-transform: none;
}

.footer-menu-link:hover {
    color: var(--accent-color);
}

.main-footer p {
    color: var(--text-muted);
    margin: 0;
}

.no-channels {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

/* Responsive Design */
@media (min-width: 768px) {
    .header-content {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .search-box {
        flex: 1;
        max-width: 400px;
        margin: 0 1rem;
    }
    
    .video-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 auto 1rem;
    }
    
    /* Ensure video-wrapper is full width in player-section - OVERRIDE ALL OTHER RULES */
    .player-section .video-wrapper,
    .player-container .video-wrapper {
        max-width: 100% !important;
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin: 0 !important;
    }
    
    .main-content .container {
        display: grid;
        grid-template-columns: 1fr 300px;
        gap: 2rem;
        max-width: 1400px;
        margin: 0 auto;
        padding: 0 3rem;
        box-sizing: border-box;
    }
    
    /* Channels section is already handled in the main desktop layout above */
}

/* Video.js Custom Styles */
.video-js {
    width: 100%;
    height: 100%;
}

.video-js .vjs-big-play-button {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.video-js .vjs-control-bar {
    background-color: rgba(0, 0, 0, 0.7);
}

/* Loading States */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}


/* Ensure proper centering for desktop */
#mainContainer {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

/* Ensure player section is centered */
.player-section {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Ensure player-info-desktop is properly visible and positioned below player */
@media (min-width: 769px) {
    .player-info-desktop {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        margin-top: 1.5rem;
        padding-top: 1.5rem;
        border-top: 2px solid var(--border-color);
        width: 100%;
        order: 2; /* Ensure it appears after video-wrapper */
    }
    
    .video-wrapper {
        order: 1; /* Ensure video appears first */
    }
    
    /* Force hide channel name mobile on desktop */
    .channel-name-mobile,
    .channel-name-mobile *,
    .channel-title-mobile {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        opacity: 0 !important;
        position: absolute !important;
        left: -9999px !important;
    }
}

/* Notification Permission Prompt */
.notification-prompt {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    background: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 1.5rem;
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification-prompt-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
}

.notification-prompt-icon {
    font-size: 3rem;
    line-height: 1;
}

.notification-prompt h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
}

.notification-prompt p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.notification-prompt-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    margin-top: 0.5rem;
}

.notification-prompt-actions .btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.notification-prompt-actions .btn-primary {
    background: var(--accent-color);
    color: white;
}

.notification-prompt-actions .btn-primary:hover {
    background: var(--accent-color-hover, #ff8800);
    transform: translateY(-1px);
}

.notification-prompt-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.notification-prompt-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 768px) {
    .notification-prompt {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

