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

:root {
    --bg-color: #0a0f1c; /* Deep Rich Black */
    --text-color: #f8fafc;
    --primary-color: #ef4444; /* Netflix Red / Dynamic Red */
    --secondary-bg: #111827;
    --hover-bg: #1f2937;
    --card-bg: rgba(30, 41, 59, 0.6);
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
    --bg-color: #f1f5f9;
    --text-color: #0f172a;
    --primary-color: #dc2626;
    --secondary-bg: #ffffff;
    --hover-bg: #e2e8f0;
    --card-bg: rgba(255, 255, 255, 0.8);
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Outfit', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-color);
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 40px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
    transition: background 0.3s ease;
}

header.scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.logo-container h1 {
    margin: 0;
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -1px;
    text-transform: uppercase;
}

.search-bar input {
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
    outline: none;
    width: 300px;
    font-family: 'Outfit', sans-serif;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Hero Banner */
.hero-banner {
    position: relative;
    height: 50vh;
    min-height: 380px;
    display: flex;
    align-items: flex-end;
    padding: 40px 40px;
    background-size: cover;
    background-position: center;
    background-image: url('/assets/img/hero-bg.jpg');
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--bg-color) 0%, rgba(10, 15, 28, 0.3) 50%, rgba(10, 15, 28, 0.8) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.hero-content h2 {
    font-size: 48px;
    font-weight: 800;
    margin: 0 0 15px 0;
    line-height: 1.1;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 25px;
}

.btn-watch {
    display: inline-flex;
    align-items: center;
    background: var(--primary-color);
    color: white;
    padding: 12px 30px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-watch:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.4);
    color: white;
}

/* Sliders / Rows / Grids */
.channels-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.slider-container {
    padding: 0 40px;
    margin-bottom: 40px;
    position: relative;
}

.slider-container h3 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #fff;
}

.slider-row {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 0 20px 0;
    scrollbar-width: none; /* Firefox */
    scroll-behavior: smooth;
}

.slider-row::-webkit-scrollbar {
    display: none; /* Chrome */
}

/* Glassmorphism & Cards */
.channel-card {
    background: rgba(255, 255, 255, 0.03);
    border: none;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    aspect-ratio: 16/9;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    flex: 0 0 calc(16.666% - 15px);
    min-width: 160px;
}

.channel-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(229, 9, 20, 0.3);
    border-color: rgba(229, 9, 20, 0.5);
    z-index: 2;
}

.channel-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.channel-card:hover img {
    transform: scale(1.05);
    opacity: 0.8;
}

.channel-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 15px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    transform: translateY(10px);
    opacity: 0.9;
    transition: all 0.3s ease;
}

.channel-card:hover .channel-info {
    transform: translateY(0);
    opacity: 1;
}

.channel-info h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 700;
    color: white;
}

/* Badges & Pulses */
.badge {
    background: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pulse {
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
    0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Player Page */
.player-page-wrapper {
    padding: 100px 40px 40px 40px;
    max-width: 1600px;
    margin: 0 auto;
}

.player-layout {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.video-section {
    flex: 1 1 70%;
    min-width: 300px;
}

.chat-section {
    flex: 1 1 25%;
    min-width: 300px;
    height: calc(100vh - 150px);
    display: flex;
    flex-direction: column;
}

.video-wrapper {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    border: 1px solid var(--border-color);
}

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

.channel-meta {
    margin-top: 20px;
    padding: 20px;
}

.channel-meta h2 {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 10px 0;
}

.favorite-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 14px;
}

.favorite-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Forms & Inputs */
input, select, button {
    font-family: 'Outfit', sans-serif;
}

.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn:hover {
    background: #b91c1c;
}

/* Chat UI */
#chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-msg {
    background: rgba(255,255,255,0.05);
    padding: 12px;
    border-radius: 12px;
    border-bottom-left-radius: 2px;
    font-size: 14px;
    border: 1px solid var(--border-color);
}

.chat-msg strong {
    color: var(--primary-color);
    font-size: 15px;
}

.chat-msg .time {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-left: 10px;
}

#chat-form {
    padding: 20px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 10px;
}

#chat-input {
    flex: 1;
    padding: 12px 15px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.05);
    color: var(--text-color);
    outline: none;
}

#chat-input:focus {
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 768px) {
    header { padding: 15px 20px; }
    .hero-banner { height: 50vh; min-height: 300px; padding: 40px 20px; }
    .hero-content h2 { font-size: 32px; }
    .slider-container { padding: 0 20px; }
    .channel-card { flex: 0 0 calc(40% - 15px); }
    .player-page-wrapper { padding: 80px 20px 20px 20px; }
    .chat-section { height: 400px; }
}

/* Picture in Picture (Floating Player) */
.pip-mode {
    position: fixed !important;
    bottom: 20px;
    right: 20px;
    width: 320px !important;
    height: auto !important;
    aspect-ratio: 16/9;
    z-index: 9999;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    transition: all 0.3s ease;
    border: 2px solid var(--primary-color);
    background: #000;
}

/* Profile Dashboard Layout */
.profile-layout {
    display: flex;
    gap: 30px;
    margin-top: 40px;
    align-items: flex-start;
}

.profile-sidebar {
    flex: 0 0 250px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px 0;
    position: sticky;
    top: 100px;
    border: 1px solid var(--border-color);
}

.profile-nav-btn {
    display: block;
    width: 100%;
    padding: 15px 25px;
    background: transparent;
    border: none;
    color: var(--text-color);
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.profile-nav-btn:hover {
    background: rgba(255,255,255,0.05);
}

.profile-nav-btn.active {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: 700;
}

.profile-content {
    flex: 1;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 30px;
    border: 1px solid var(--border-color);
    min-height: 500px;
}

.tab-pane {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-pane.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .profile-layout {
        flex-direction: column;
    }
    .profile-sidebar {
        flex: auto;
        width: 100%;
        position: static;
        display: flex;
        overflow-x: auto;
        padding: 10px;
    }
    .profile-nav-btn {
        flex: 0 0 auto;
        padding: 10px 15px;
        border-left: none;
        border-bottom: 3px solid transparent;
        text-align: center;
    }
    .profile-nav-btn.active {
        border-left: none;
        border-bottom: 3px solid var(--primary-color);
    }
}

@media (max-width: 768px) {
    .pip-mode {
        width: 250px !important;
        bottom: 10px;
        right: 10px;
    }
}

/* Smart TV & D-Pad Remote Control Focus Highlighting */
:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, .channel-card:focus-visible {
    outline: 3px solid #e67e22 !important;
    outline-offset: 3px !important;
    box-shadow: 0 0 20px rgba(230, 126, 34, 0.8) !important;
    border-radius: 8px !important;
}

/* 📱 Mobile Bottom Navigation Bar & Mobile Responsive UI */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-border);
    z-index: 9990;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -5px 25px rgba(0,0,0,0.5);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    gap: 3px;
    flex: 1;
    height: 100%;
    transition: color 0.2s ease, transform 0.2s ease;
}

.mobile-nav-item.active, .mobile-nav-item:hover {
    color: var(--primary-color);
}

.mobile-nav-item i, .mobile-nav-item span.nav-icon {
    font-size: 20px;
}

/* Category Touch Horizontal Slider */
.category-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 0 15px 0;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
}

.category-slider::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-pill {
    flex: 0 0 auto;
    padding: 8px 18px;
    border-radius: 30px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.25s ease;
}

.category-pill.active, .category-pill:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

@media (max-width: 768px) {
    body {
        padding-bottom: 70px !important; /* Space for bottom nav */
    }

    header {
        padding: 12px 18px !important;
    }

    .logo-container h1 {
        font-size: 22px !important;
    }

    .hero-banner {
        height: 38vh !important;
        min-height: 280px !important;
        padding: 20px !important;
    }

    .hero-content h2 {
        font-size: 28px !important;
    }

    .hero-content p {
        font-size: 14px !important;
    }

    .search-bar input {
        width: 140px !important;
        font-size: 13px !important;
        padding: 8px 14px !important;
    }

    .mobile-bottom-nav {
        display: flex !important;
    }

    /* Mobile Channel & Movie Grids */
    .channel-grid, .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)) !important;
        gap: 12px !important;
    }

    .channel-card {
        padding: 10px !important;
    }

    .channel-logo img {
        height: 50px !important;
    }

    .channel-name {
        font-size: 13px !important;
    }

    /* Mobile Player Layout */
    .video-wrapper {
        border-radius: 0 !important;
    }
}

/* 📺 Big Screen TV Mode (10-Foot Couch Experience) */
body.tv-mode {
    font-size: 20px !important;
}

body.tv-mode .channel-card {
    min-width: 220px !important;
    padding: 18px !important;
}

body.tv-mode .channel-logo img {
    height: 90px !important;
}

body.tv-mode .channel-name {
    font-size: 18px !important;
    font-weight: 700 !important;
}

body.tv-mode .hero-content h2 {
    font-size: 56px !important;
}

body.tv-mode .category-pill {
    padding: 12px 28px !important;
    font-size: 18px !important;
}

/* 🖥️ 100% Edge-to-Edge True Fullscreen Mode */
body.has-tv-fullscreen {
    overflow: hidden !important;
}

body.has-tv-fullscreen #main-header,
body.has-tv-fullscreen .mobile-bottom-nav,
body.has-tv-fullscreen footer,
body.has-tv-fullscreen #tv-remote-badge {
    display: none !important;
}

.video-container.tv-fullscreen-override,
.video-wrapper.tv-fullscreen-override {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999999 !important;
    border-radius: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: #000 !important;
}

.video-container.tv-fullscreen-override video,
.video-wrapper.tv-fullscreen-override video {
    width: 100vw !important;
    height: 100vh !important;
    object-fit: fill !important;
    border-radius: 0 !important;
}

/* 🎬 Custom Player Bottom Control Bar */
.custom-player-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 54px;
    background: linear-gradient(0deg, rgba(15, 23, 42, 0.95) 0%, rgba(15, 23, 42, 0) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 28;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.video-container:hover .custom-player-bar,
.video-wrapper:hover .custom-player-bar,
.custom-player-bar:hover,
body.tv-mode .custom-player-bar {
    opacity: 1;
}

.p-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.p-btn:hover {
    background: #e67e22;
    border-color: #e67e22;
    transform: scale(1.08);
}



