@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Tokens */
    --bg-base: #060813;
    --bg-surface: rgba(15, 22, 42, 0.6);
    --bg-surface-hover: rgba(30, 41, 59, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-glass-hover: rgba(255, 255, 255, 0.18);
    
    --primary: #818cf8;
    --primary-glow: rgba(129, 140, 248, 0.3);
    --secondary: #c084fc;
    --accent: #f43f5e;
    --accent-glow: rgba(244, 63, 94, 0.4);
    --success: #34d399;
    
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 20px 0 var(--primary-glow);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--text-dim) var(--bg-base);
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.12) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(168, 85, 247, 0.1) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--text-dim);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

a {
    color: inherit;
    text-decoration: none;
}

/* Header & Navbar */
header {
    background: rgba(6, 8, 19, 0.75);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: var(--transition-smooth);
}

.nav-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    letter-spacing: -0.5px;
    font-family: var(--font-heading);
}

.logo-text {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.logo-tag {
    font-size: 0.65rem;
    background: var(--accent);
    color: white;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Search Bar styling */
.search-wrapper {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border-radius: 30px;
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 0.95rem;
    transition: var(--transition-smooth);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px 0 rgba(129, 140, 248, 0.15);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Navigation Links */
.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-item {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.nav-item:hover, .nav-item.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* Main Content Layout */
main {
    flex: 1;
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Categories Bar */
.categories-bar {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    scroll-behavior: smooth;
}

.categories-bar::-webkit-scrollbar {
    height: 4px;
}

.category-chip {
    white-space: nowrap;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: var(--transition-smooth);
    cursor: pointer;
}

.category-chip:hover {
    color: var(--text-main);
    border-color: var(--border-glass-hover);
    background: var(--bg-surface-hover);
    transform: translateY(-1px);
}

.category-chip.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #060813;
    border-color: transparent;
    font-weight: 600;
    box-shadow: var(--shadow-glow);
}

/* Featured Hero Section */
.hero-section {
    margin-bottom: 3rem;
}

.hero-banner {
    background: linear-gradient(rgba(6, 8, 19, 0.75), rgba(6, 8, 19, 0.55)), url('/static/images/world_cup_banner.png') no-repeat center center;
    background-size: cover;
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 4.5rem 3.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-premium);
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(129, 140, 248, 0.15) 0%, transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 650px;
}

.hero-badge {
    background: rgba(244, 63, 94, 0.2);
    border: 1px solid var(--accent);
    color: #fda4af;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.5rem;
}

.hero-badge .live-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #ffffff, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #060813;
    font-family: var(--font-heading);
    font-weight: 700;
    padding: 0.85rem 2rem;
    border-radius: 30px;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: var(--shadow-glow);
    transition: var(--transition-smooth);
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px 0 rgba(129, 140, 248, 0.4);
}

/* Sections & Grid */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    border-radius: 2px;
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* Channel Card */
.channel-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-premium);
}

.channel-card:hover {
    background: var(--bg-surface-hover);
    border-color: var(--border-glass-hover);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.8), 0 0 15px 0 rgba(129, 140, 248, 0.1);
}

.channel-logo-wrapper {
    width: 90px;
    height: 90px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    margin-bottom: 1rem;
    position: relative;
    transition: var(--transition-smooth);
}

.channel-card:hover .channel-logo-wrapper {
    border-color: var(--primary);
    box-shadow: 0 0 15px 0 rgba(129, 140, 248, 0.2);
}

.channel-logo {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.channel-info {
    text-align: center;
    width: 100%;
}

.channel-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.channel-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    display: inline-block;
}

.play-hover-btn {
    position: absolute;
    bottom: -40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #060813;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
    opacity: 0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.channel-card:hover .play-hover-btn {
    bottom: 12px;
    opacity: 1;
}

.channel-card:hover .channel-info {
    transform: translateY(-8px);
}

.channel-info {
    transition: var(--transition-smooth);
}

/* ==============================================================================
   Player Page Layout
   ============================================================================== */
.player-container {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    margin-top: 1rem;
}

@media (max-width: 1024px) {
    .player-container {
        grid-template-columns: 1fr;
    }
}

.video-player-wrapper {
    background: #000;
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    aspect-ratio: 16/9;
    position: relative;
}

.artplayer-container {
    width: 100%;
    height: 100%;
}

.channel-meta-section {
    margin-top: 1.5rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-premium);
}

.channel-meta-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
}

.channel-title-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.player-channel-logo {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 50%;
    padding: 0.5rem;
    object-fit: contain;
}

.channel-meta-title {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.proxy-indicator {
    background: rgba(52, 211, 153, 0.15);
    border: 1px solid var(--success);
    color: #a7f3d0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.proxy-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--success);
    border-radius: 50%;
}

/* Sidebar Channels List */
.sidebar-section {
    background: var(--bg-surface);
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: var(--shadow-premium);
    height: calc(100vh - 140px);
    position: sticky;
    top: 95px;
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.75rem;
}

.sidebar-scroll {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-right: 0.5rem;
}

.sidebar-channel-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.02);
    border: 1px solid transparent;
    transition: var(--transition-smooth);
}

.sidebar-channel-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--border-glass);
    transform: translateX(4px);
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.03);
    padding: 0.35rem;
    object-fit: contain;
}

.sidebar-info {
    flex: 1;
    min-width: 0;
}

.sidebar-name {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-category {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Footer Section */
footer {
    background: rgba(4, 6, 14, 0.9);
    border-top: 1px solid var(--border-glass);
    padding: 2.5rem 2rem;
    margin-top: auto;
    text-align: center;
}

.footer-content {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-text {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-link {
    color: var(--text-dim);
    transition: var(--transition-smooth);
    font-size: 0.85rem;
}

.footer-link:hover {
    color: var(--text-main);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.6;
    }
}

/* ==============================================================================
   Adsterra Dynamic Ad Layout Containers (CLS Protection)
   ============================================================================== */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.5rem auto;
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    overflow: hidden;
    transition: var(--transition-smooth);
}

.ad-container iframe {
    display: block;
    margin: 0 auto;
}

.ad-leaderboard {
    max-width: 728px;
    min-height: 90px;
    width: 100%;
}

.ad-sidebar {
    max-width: 300px;
    min-height: 250px;
    width: 100%;
    margin: 1rem auto;
    background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .ad-leaderboard {
        max-width: 320px;
        min-height: 50px;
    }
}
