/* Netflix-Style IPTV Portal */

:root {
    --bg-primary: #141414;
    --bg-secondary: #181818;
    --bg-card: #232323;
    --bg-hover: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --text-muted: #808080;
    --accent: #e50914;
    --accent-hover: #f6121d;
    --success: #46d369;
    --gradient-start: rgba(20, 20, 20, 0);
    --gradient-end: rgba(20, 20, 20, 1);
    --card-radius: 4px;
    --transition-fast: 0.15s ease;
    --transition-medium: 0.3s ease;
    --navbar-height: 68px;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== NAVBAR ==================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4%;
    z-index: 1000;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 10%, transparent);
    transition: background var(--transition-medium);
}

.navbar.scrolled {
    background: var(--bg-primary);
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 40px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
}

.logo i {
    font-size: 1.8rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid var(--text-secondary);
    padding: 6px 12px;
    gap: 8px;
    opacity: 0;
    width: 0;
    overflow: hidden;
    transition: all var(--transition-medium);
}

.search-box.active {
    opacity: 1;
    width: 250px;
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    width: 100%;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.nav-icon {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    transition: color var(--transition-fast);
}

.nav-icon:hover {
    color: var(--text-secondary);
}

/* Mobile nav */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .navbar {
        padding: 0 3%;
    }
}

/* ==================== HERO SECTION ==================== */
.hero {
    position: relative;
    height: 85vh;
    min-height: 500px;
    max-height: 900px;
    display: flex;
    align-items: flex-end;
    padding: 0 4% 15%;
    margin-bottom: -100px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center top;
    transition: background-image 0.5s ease;
}

.hero-gradient {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(to top, var(--bg-primary) 0%, transparent 50%),
        linear-gradient(to right, rgba(20,20,20,0.9) 0%, transparent 50%);
}

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

.hero-badge {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: 2px;
    margin-bottom: 16px;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 16px;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-play, .btn-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border: none;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-play {
    background: white;
    color: black;
}

.btn-play:hover {
    background: rgba(255,255,255,0.85);
}

.btn-info {
    background: rgba(109, 109, 110, 0.7);
    color: white;
}

.btn-info:hover {
    background: rgba(109, 109, 110, 0.5);
}

.hero-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .hero {
        height: 70vh;
        padding: 0 3% 20%;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
        -webkit-line-clamp: 2;
    }

    .btn-play, .btn-info {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
}

/* ==================== CONTENT ROWS ==================== */
.content-rows {
    position: relative;
    z-index: 20;
    padding: 0 0 50px;
}

.content-row {
    margin-bottom: 40px;
    padding: 0 4%;
}

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

.row-title {
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.row-title .explore {
    display: none;
    color: var(--accent);
    font-size: 0.875rem;
    font-weight: 400;
}

.row-header:hover .explore {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.row-slider {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 20px 0;
    margin: -20px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

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

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 100%;
    background: rgba(20, 20, 20, 0.7);
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 10;
}

.content-row:hover .slider-btn {
    opacity: 1;
}

.slider-btn.prev {
    left: 0;
}

.slider-btn.next {
    right: 0;
}

/* ==================== CONTENT CARDS ==================== */
.content-card {
    flex: 0 0 auto;
    width: 240px;
    cursor: pointer;
    transition: transform var(--transition-medium), z-index 0s 0.3s;
    position: relative;
}

.content-card:hover {
    transform: scale(1.3);
    z-index: 100;
    transition: transform var(--transition-medium), z-index 0s;
}

.content-card:first-child:hover {
    transform: scale(1.3) translateX(15%);
}

.content-card:last-child:hover {
    transform: scale(1.3) translateX(-15%);
}

.card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: var(--bg-card);
    border-radius: var(--card-radius);
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter var(--transition-fast);
}

.content-card:hover .card-image img {
    filter: brightness(0.7);
}

.card-image .placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    color: var(--text-muted);
    font-size: 2.5rem;
}

.placeholder span {
    font-size: 0.75rem;
    margin-top: 8px;
    max-width: 90%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    padding: 12px;
    transform: translateY(100%);
    opacity: 0;
    transition: all var(--transition-medium);
    border-radius: 0 0 var(--card-radius) var(--card-radius);
}

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

.card-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.card-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    background: rgba(0,0,0,0.6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.card-btn:hover {
    border-color: white;
    background: rgba(255,255,255,0.1);
}

.card-btn.play {
    background: white;
    border-color: white;
    color: black;
}

.card-btn.play:hover {
    background: rgba(255,255,255,0.85);
}

.card-title {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.card-meta .live {
    color: var(--accent);
    font-weight: 600;
}

.card-meta .match {
    color: var(--success);
}

.card-meta .rating {
    color: #ffc107;
    font-weight: 600;
}

.card-meta .rating i {
    font-size: 0.6rem;
    margin-right: 2px;
}

.badge-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Movie cards (vertical posters) */
.content-card.movie {
    width: 180px;
}

.content-card.movie .card-image {
    aspect-ratio: 2/3;
}

/* ==================== CHANNEL CARDS (Square Tiles) ==================== */
.content-card.channel {
    width: 160px;
}

.content-card.channel .card-image {
    aspect-ratio: 1/1;
    background: linear-gradient(145deg, #1e1e2e 0%, #0d0d14 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.content-card.channel .card-image img {
    width: 80%;
    height: 80%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.content-card.channel .placeholder {
    background: linear-gradient(145deg, #252538 0%, #16161f 100%);
    padding: 16px;
}

.content-card.channel .placeholder i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 8px;
}

.content-card.channel .placeholder span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Live badge for channels */
.content-card.channel .badge-live {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: white;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Channel name overlay at bottom */
.content-card.channel .channel-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 60%, transparent 100%);
    padding: 24px 10px 10px;
    text-align: center;
}

.content-card.channel .channel-name span {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content-card.channel .channel-name .category {
    font-size: 0.65rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Hover effect for channels */
.content-card.channel:hover {
    transform: scale(1.1);
}

.content-card.channel:hover .card-image {
    box-shadow: 0 0 0 3px var(--accent), 0 8px 24px rgba(229, 9, 20, 0.3);
}

/* Focus state for TV navigation */
.content-card.channel:focus,
.content-card.channel.focused {
    outline: none;
    transform: scale(1.1);
}

.content-card.channel:focus .card-image,
.content-card.channel.focused .card-image {
    box-shadow: 0 0 0 3px var(--accent), 0 8px 24px rgba(229, 9, 20, 0.4);
}

/* Channel card info on hover */
.content-card.channel .card-info {
    display: none;
}

@media (max-width: 768px) {
    .content-card {
        width: 140px;
    }

    .content-card.movie {
        width: 120px;
    }

    .content-card.channel {
        width: 120px;
    }

    .content-card.channel .card-image {
        padding: 16px;
    }

    .content-card.channel .placeholder i {
        font-size: 2rem;
    }

    .content-card.channel .channel-name span {
        font-size: 0.7rem;
    }

    .content-card:hover {
        transform: scale(1.05);
    }

    .content-card.channel:hover {
        transform: scale(1.08);
    }

    .card-info {
        display: none;
    }

    .row-title {
        font-size: 1.1rem;
    }
}

/* TV mode - larger channel cards */
@media (min-width: 1920px) {
    .content-card.channel {
        width: 200px;
    }

    .content-card.channel .channel-name span {
        font-size: 1rem;
    }

    .content-card.channel .badge-live {
        font-size: 0.7rem;
        padding: 4px 10px;
    }
}

/* ==================== VIDEO MODAL ==================== */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.video-modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    animation: scaleIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-primary);
    border: none;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
}

.modal-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: black;
}

.modal-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Player Controls */
.player-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.modal-player:hover .player-controls,
.player-controls.active {
    opacity: 1;
}

.controls-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    pointer-events: none;
}

.controls-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}

.video-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.controls-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.control-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
    opacity: 0.9;
    transition: opacity var(--transition-fast);
}

.control-btn:hover {
    opacity: 1;
}

.control-btn.large {
    font-size: 3rem;
    background: rgba(0,0,0,0.4);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.controls-bottom {
    position: relative;
    padding: 0 16px 16px;
    z-index: 10;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-bar:hover {
    height: 6px;
}

.controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.controls-left, .controls-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.time-display {
    font-size: 0.875rem;
    color: white;
}

/* Player Loading */
.player-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
}

.player-loading.active {
    display: flex;
}

.loader {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255,255,255,0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Ad Overlay */
.ad-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: black;
    display: none;
    z-index: 50;
}

.ad-overlay.active {
    display: block;
}

.ad-overlay video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ad-badge {
    position: absolute;
    bottom: 16px;
    left: 16px;
    background: rgba(255, 204, 0, 0.9);
    color: black;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 2px;
}

.ad-skip {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0,0,0,0.8);
    border: 1px solid rgba(255,255,255,0.5);
    color: white;
    padding: 8px 16px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ad-skip.clickable {
    background: var(--accent);
    border-color: var(--accent);
}

.ad-skip.clickable:hover {
    background: var(--accent-hover);
}

/* ==================== CATEGORY BROWSER ==================== */
.category-browser {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 1500;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.category-browser.active {
    display: flex;
}

.category-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 4%;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--bg-hover);
    z-index: 10;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: none;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast);
}

.back-btn:hover {
    background: var(--bg-hover);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 20px 4%;
}

.category-grid .content-card {
    width: 100%;
}

.category-grid .content-card:hover {
    transform: scale(1.05);
}

/* ==================== MOBILE BOTTOM NAV ==================== */
@media (max-width: 768px) {
    body {
        padding-bottom: 70px;
    }

    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: var(--bg-secondary);
        display: flex;
        justify-content: space-around;
        align-items: center;
        border-top: 1px solid var(--bg-hover);
        z-index: 1000;
    }

    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        background: none;
        border: none;
        color: var(--text-muted);
        font-size: 0.7rem;
        cursor: pointer;
        padding: 8px 16px;
        transition: color var(--transition-fast);
    }

    .mobile-nav-btn i {
        font-size: 1.5rem;
    }

    .mobile-nav-btn.active {
        color: white;
    }
}

/* ==================== UTILITIES ==================== */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Loading skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==================== STATS BANNER ==================== */
.stats-banner {
    display: flex;
    justify-content: center;
    gap: 48px;
    padding: 24px 4%;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.1) 0%, rgba(109, 40, 217, 0.1) 100%);
    border-radius: 8px;
    margin-left: 4%;
    margin-right: 4%;
}

.stat {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ==================== GENRE PILLS ==================== */
.genre-pills {
    display: flex;
    gap: 12px;
    padding: 16px 4%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.genre-pills::-webkit-scrollbar {
    display: none;
}

.genre-pill {
    padding: 10px 20px;
    border: 1px solid var(--text-muted);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.genre-pill:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.genre-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

/* ==================== MOVIE CARD ENHANCEMENTS ==================== */
.content-card.movie .card-meta .rating {
    color: #ffc107;
}

.content-card.movie .card-meta .rating i {
    font-size: 0.75rem;
    margin-right: 2px;
}

.badge-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #4ade80;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 2px;
    border: 1px solid #4ade80;
}

/* ==================== RESPONSIVE STATS ==================== */
@media (max-width: 768px) {
    .stats-banner {
        flex-wrap: wrap;
        gap: 24px;
    }

    .stat {
        flex: 1 1 40%;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .genre-pills {
        padding: 12px 4%;
        gap: 8px;
    }

    .genre-pill {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* ==================== LAZY LOADED SECTIONS ==================== */
.lazy-section .lazy-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.8), rgba(20, 20, 20, 0.9));
    border-radius: 8px;
    margin: 0 4%;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    gap: 16px;
}

.lazy-placeholder .lazy-info {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.lazy-placeholder .lazy-info i {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.lazy-placeholder .lazy-info.error {
    color: #f87171;
}

.lazy-placeholder .lazy-info.error i {
    color: #f87171;
}

.lazy-placeholder .load-btn,
.lazy-placeholder .retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.lazy-placeholder .load-btn:hover,
.lazy-placeholder .retry-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.lazy-placeholder .loading-spinner {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.lazy-placeholder .loading-spinner .spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive lazy sections */
@media (max-width: 768px) {
    .lazy-section .lazy-placeholder {
        padding: 30px 16px;
        margin: 0 16px;
    }

    .lazy-placeholder .lazy-info {
        font-size: 0.85rem;
        text-align: center;
        flex-direction: column;
    }

    .lazy-placeholder .load-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* ==================== EXPLORE ALL BUTTON ==================== */
.explore-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: 16px;
}

.explore-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: translateX(4px);
}

.explore-btn i {
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.explore-btn:hover i {
    transform: translateX(3px);
}

/* Category Grid Enhancements */
.loading-grid,
.empty-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-secondary);
    font-size: 1rem;
    gap: 10px;
}

.loading-grid .spin {
    animation: spin 1s linear infinite;
}

.card-info-mini {
    padding: 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.card-info-mini .card-title {
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-info-mini .card-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Category Browser Grid Improvements */
#categoryGrid .content-card {
    position: relative;
    overflow: hidden;
}

#categoryGrid .content-card.movie {
    aspect-ratio: 2/3;
}

#categoryGrid .content-card.channel {
    aspect-ratio: 1/1;
}

#categoryGrid .content-card.channel .card-image {
    aspect-ratio: 1/1;
}

#categoryGrid .content-card:hover {
    transform: scale(1.05);
    z-index: 10;
}

#categoryGrid .content-card.channel:hover {
    transform: scale(1.08);
}

#categoryGrid .content-card.channel:hover .card-image {
    box-shadow: 0 0 0 3px var(--accent), 0 8px 20px rgba(229, 9, 20, 0.3);
}

/* Responsive explore button */
@media (max-width: 768px) {
    .explore-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }
    
    .row-title {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }
}

/* ==================== MOBILE FULL WIDTH OPTIMIZATION ==================== */
@media (max-width: 768px) {
    /* Remove horizontal padding for full width */
    .content-row {
        padding: 0;
        margin-bottom: 24px;
    }
    
    /* Row header with minimal padding for title */
    .content-row .row-header {
        padding: 0 12px;
        margin-bottom: 8px;
    }
    
    /* Slider goes edge to edge */
    .row-slider {
        padding: 0 12px;
        gap: 10px;
        scroll-padding-left: 12px;
    }
    
    /* First card aligned to edge */
    .row-slider::before {
        content: none;
    }
    
    /* Cards slightly larger on mobile for easier tapping */
    .content-card {
        width: 130px;
        flex-shrink: 0;
    }
    
    .content-card.movie {
        width: 110px;
    }
    
    /* Hero section full width */
    .hero {
        padding: 0 12px 25%;
        height: 60vh;
        min-height: 350px;
    }
    
    .hero-content {
        max-width: 100%;
    }
    
    .hero-title {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    
    .hero-description {
        font-size: 0.9rem;
        -webkit-line-clamp: 2;
        line-clamp: 2;
    }
    
    .hero-buttons {
        gap: 8px;
    }
    
    .btn-play, .btn-info {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    /* Stats banner full width */
    .stats-banner {
        margin: 0;
        padding: 16px 12px;
        border-radius: 0;
        gap: 16px;
    }
    
    .stat {
        flex: 1 1 45%;
        padding: 8px;
    }
    
    .stat-value {
        font-size: 1.3rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* Genre pills full width scroll */
    .genre-pills {
        padding: 12px;
        gap: 8px;
        margin: 0;
    }
    
    .genre-pill {
        padding: 6px 12px;
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    /* Lazy sections full width */
    .lazy-section .lazy-placeholder {
        margin: 0 12px;
        padding: 24px 16px;
        border-radius: 8px;
    }
    
    /* Category browser full screen on mobile */
    .category-browser {
        padding-top: 60px;
    }
    
    .category-browser-header {
        padding: 0 12px;
    }
    
    #categoryGrid {
        padding: 12px;
        gap: 10px;
        grid-template-columns: repeat(3, 1fr);
    }
    
    #categoryGrid .content-card {
        width: 100%;
    }
    
    /* Explore button compact */
    .explore-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
        margin-left: 8px;
    }
    
    /* Row title smaller */
    .row-title {
        font-size: 1rem;
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
    }
    
    /* Navbar more compact */
    .navbar {
        height: 56px;
        padding: 0 12px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo i {
        font-size: 1.4rem;
    }
    
    /* Video modal full screen */
    .video-container {
        width: 100vw;
        height: 56.25vw;
        max-height: 40vh;
    }
    
    .video-info {
        padding: 16px 12px;
    }
    
    .video-title {
        font-size: 1.2rem;
    }
    
    /* Mobile nav adjustments */
    .mobile-nav {
        height: 60px;
    }
    
    body {
        padding-bottom: 60px;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .content-card {
        width: 115px;
    }
    
    .content-card.movie {
        width: 100px;
    }
    
    .hero-title {
        font-size: 1.4rem;
    }
    
    .stat {
        flex: 1 1 40%;
    }
    
    #categoryGrid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .row-slider {
        gap: 8px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        height: 80vh;
        min-height: 250px;
        padding-bottom: 15%;
    }
    
    .hero-title {
        font-size: 1.4rem;
    }
    
    .hero-description {
        display: none;
    }
    
    .content-card {
        width: 120px;
    }
    
    .content-card.movie {
        width: 100px;
    }
    
    .video-container {
        height: 70vh;
        max-height: none;
    }
}

/* ==================== GESTURE FEEDBACK OVERLAY ==================== */
.gesture-feedback {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 40;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gesture-feedback.active {
    opacity: 1;
}

.gesture-feedback .feedback-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.7);
    padding: 24px 36px;
    border-radius: 12px;
    backdrop-filter: blur(8px);
    animation: feedbackPop 0.2s ease;
}

@keyframes feedbackPop {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.gesture-feedback .feedback-icon {
    font-size: 3rem;
    color: white;
}

.gesture-feedback .feedback-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

/* Touch-friendly larger controls on mobile */
@media (max-width: 768px) {
    .control-btn {
        padding: 12px;
        font-size: 1.5rem;
    }

    .control-btn.large {
        width: 70px;
        height: 70px;
        font-size: 2.5rem;
    }

    .progress-bar {
        height: 8px;
    }

    .controls-bottom {
        padding: 0 12px 12px;
    }

    .gesture-feedback .feedback-content {
        padding: 20px 28px;
    }

    .gesture-feedback .feedback-icon {
        font-size: 2.5rem;
    }

    .gesture-feedback .feedback-text {
        font-size: 1.1rem;
    }
}

/* TV-specific focus states for D-pad navigation */
.control-btn:focus {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

.control-btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
    background: rgba(255, 255, 255, 0.2);
}

/* Volume indicator bar */
.volume-indicator {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 120px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 45;
}

.volume-indicator.active {
    opacity: 1;
}

.volume-indicator .volume-level {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--accent);
    border-radius: 3px;
    transition: height 0.1s ease;
}

/* Seek indicator */
.seek-indicator {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 45;
}

.seek-indicator.active {
    opacity: 1;
}

.seek-indicator i {
    font-size: 2rem;
    color: white;
}

.seek-indicator span {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
}

/* TV mode - larger UI elements */
@media (min-width: 1920px) {
    .control-btn {
        padding: 16px;
        font-size: 1.75rem;
    }

    .control-btn.large {
        width: 100px;
        height: 100px;
        font-size: 4rem;
    }

    .video-title {
        font-size: 1.75rem;
    }

    .time-display {
        font-size: 1.25rem;
    }

    .progress-bar {
        height: 8px;
    }

    .gesture-feedback .feedback-icon {
        font-size: 4rem;
    }

    .gesture-feedback .feedback-text {
        font-size: 1.75rem;
    }
}

/* Android App Banner */
.app-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: linear-gradient(135deg, #1a5f2a 0%, #0d3d17 100%);
    padding: 12px 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.app-banner-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.app-banner-icon {
    font-size: 24px;
    color: #4ade80;
}

.app-banner-text {
    display: flex;
    flex-direction: column;
    color: white;
    text-align: left;
}

.app-banner-text strong {
    font-size: 14px;
    font-weight: 600;
}

.app-banner-text span {
    font-size: 12px;
    opacity: 0.9;
}

.app-banner-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #4ade80;
    color: #0d3d17;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.app-banner-btn:hover {
    background: #22c55e;
    transform: scale(1.02);
}

.app-banner-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.app-banner-close:hover {
    opacity: 1;
}

/* Adjust body when banner is shown */
body.has-app-banner {
    padding-top: 60px;
}

body.has-app-banner .navbar {
    top: 60px;
}

@media (max-width: 600px) {
    .app-banner {
        padding: 10px 12px;
    }
    
    .app-banner-content {
        gap: 8px;
    }
    
    .app-banner-text strong {
        font-size: 13px;
    }
    
    .app-banner-text span {
        font-size: 11px;
    }
    
    .app-banner-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Permanent App Download Button - Desktop Navbar */
.app-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #3ddc84 0%, #2da65a 100%);
    color: #fff;
    border-radius: 20px;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-left: 12px;
}

.app-download-btn i {
    font-size: 16px;
}

.app-download-btn:hover {
    background: linear-gradient(135deg, #4aea94 0%, #3ddc84 100%);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(61, 220, 132, 0.4);
}

/* Hide text on smaller screens, show icon only */
@media (max-width: 900px) {
    .app-download-btn span {
        display: none;
    }
    .app-download-btn {
        padding: 8px 10px;
        border-radius: 50%;
    }
}

/* Hide desktop button on mobile (use bottom nav instead) */
@media (max-width: 768px) {
    .app-download-btn {
        display: none;
    }
}

/* Mobile Bottom Nav App Link */
.mobile-nav-btn.app-link {
    color: #3ddc84;
    text-decoration: none;
}

.mobile-nav-btn.app-link i {
    color: #3ddc84;
}

.mobile-nav-btn.app-link:active {
    background: rgba(61, 220, 132, 0.2);
}

/* ==================== ENHANCED MOBILE VIEW ==================== */
@media (max-width: 768px) {
    /* Better card sizing for movies */
    .content-card.movie {
        width: 105px;
        min-width: 105px;
    }
    
    .content-card.movie .card-image {
        aspect-ratio: 2/3;
        border-radius: 6px;
        overflow: hidden;
    }
    
    /* Movie card title overlay - clean and readable */
    .content-card.movie .card-title-overlay {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 30px 6px 6px;
        background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
        border-radius: 0 0 6px 6px;
    }
    
    .content-card.movie .card-title-overlay .title {
        font-size: 0.7rem;
        font-weight: 500;
        color: white;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.2;
        text-align: center;
    }
    
    /* Channel cards - cleaner square tiles */
    .content-card.channel {
        width: 100px;
        min-width: 100px;
    }
    
    .content-card.channel .card-image {
        aspect-ratio: 1/1;
        border-radius: 8px;
        padding: 12px;
    }
    
    .content-card.channel .channel-name {
        padding: 20px 6px 6px;
    }
    
    .content-card.channel .channel-name span {
        font-size: 0.65rem;
        line-height: 1.2;
    }
    
    .content-card.channel .channel-name .category {
        display: none; /* Hide category on mobile to reduce clutter */
    }
    
    .content-card.channel .badge-live {
        font-size: 0.5rem;
        padding: 2px 5px;
        top: 5px;
        left: 5px;
    }
    
    /* Row slider with better spacing */
    .row-slider {
        gap: 8px;
        padding: 8px 12px;
        margin: 0;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Row title cleaner */
    .row-header {
        padding: 0 12px;
        margin-bottom: 6px;
    }
    
    .row-title {
        font-size: 0.95rem;
        font-weight: 600;
    }
    
    /* Content row spacing */
    .content-row {
        margin-bottom: 20px;
    }
    
    /* Disable hover effects on mobile - they cause issues */
    .content-card:hover {
        transform: none;
    }
    
    .content-card.channel:hover {
        transform: none;
    }
    
    .content-card.channel:hover .card-image {
        box-shadow: none;
    }
    
    /* Card info - hide on mobile, show only essential info */
    .content-card .card-info {
        display: none !important;
    }
    
    /* Rating badge - smaller and cleaner */
    .badge-rating {
        font-size: 0.55rem;
        padding: 1px 4px;
        top: 5px;
        right: 5px;
    }
    
    /* Placeholder styling */
    .content-card .placeholder {
        padding: 10px;
    }
    
    .content-card .placeholder i {
        font-size: 1.8rem;
    }
    
    .content-card .placeholder span {
        font-size: 0.6rem;
        margin-top: 4px;
    }
    
    /* Category grid - better mobile layout */
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 12px;
    }
    
    .category-grid .content-card {
        width: 100%;
    }
    
    .category-grid .content-card.movie {
        width: 100%;
    }
    
    .category-grid .content-card.channel {
        width: 100%;
    }
    
    /* Category header */
    .category-header {
        padding: 12px;
        gap: 12px;
    }
    
    .category-header h2 {
        font-size: 1.1rem;
    }
    
    .back-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    /* Explore button smaller */
    .explore-btn {
        padding: 4px 8px;
        font-size: 0.7rem;
        margin-left: 6px;
    }
    
    /* Video modal - better mobile experience */
    .modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }
    
    .modal-player {
        flex: 1;
        aspect-ratio: auto;
    }
    
    .modal-close {
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    /* Player controls touch-friendly */
    .controls-top {
        padding: 10px;
    }
    
    .video-title {
        font-size: 1rem;
        max-width: 70%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .controls-bottom {
        padding: 0 10px 10px;
    }
    
    .controls-row {
        gap: 8px;
    }
    
    .control-btn {
        padding: 10px;
        font-size: 1.2rem;
    }
    
    .control-btn.large {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }
    
    .time-display {
        font-size: 0.75rem;
    }
}

/* Extra small phones */
@media (max-width: 380px) {
    .content-card.movie {
        width: 90px;
        min-width: 90px;
    }
    
    .content-card.channel {
        width: 85px;
        min-width: 85px;
    }
    
    .row-slider {
        gap: 6px;
        padding: 6px 10px;
    }
    
    .row-title {
        font-size: 0.85rem;
    }
    
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-title {
        font-size: 1.2rem;
    }
    
    .btn-play, .btn-info {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}

/* Improved touch feedback */
@media (max-width: 768px) {
    .content-card {
        -webkit-tap-highlight-color: transparent;
    }
    
    .content-card:active {
        transform: scale(0.97);
        opacity: 0.9;
    }
    
    .content-card:active .card-image {
        box-shadow: 0 0 0 2px var(--accent);
    }
}
