/* ============================================
   TUVES — Netflix-style Dark Theme
   ============================================ */

/* --- Reset & Base --- */
:root {
    --bg:          #141414;
    --bg-card:     #1a1a2e;
    --bg-hover:    #252540;
    --bg-surface:  #1c1c2e;
    --text:        #e5e5e5;
    --text-muted:  #808080;
    --accent:      #e50914;
    --accent-hover:#b8070f;
    --blue:        #4f46e5;
    --gold:        #f5c518;
    --green:       #46d369;
    --border:      rgba(255,255,255,0.08);
    --radius:      6px;
    --radius-lg:   12px;
    --shadow:      0 4px 20px rgba(0,0,0,0.5);
    --transition:  all 0.25s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    background: var(--bg) !important;
    color: var(--text) !important;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: #fff; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* =====================
   NAVBAR
   ===================== */
.tv-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.75rem 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.85) 0%, transparent 100%);
    transition: background 0.3s;
}
.tv-navbar.scrolled {
    background: rgba(20,20,20,0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--border);
}
.tv-navbar .navbar-brand {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--accent) !important;
    letter-spacing: -0.5px;
}
.tv-navbar .nav-link {
    color: #b3b3b3 !important;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.4rem 0.85rem !important;
    transition: color 0.2s;
}
.tv-navbar .nav-link:hover,
.tv-navbar .nav-link.active { color: #fff !important; }

.tv-navbar .btn-signin {
    background: var(--accent);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 0.85rem;
    padding: 6px 16px;
    border-radius: var(--radius);
}
.tv-navbar .btn-signin:hover { background: var(--accent-hover); color: #fff; }

.tv-navbar .btn-signup {
    color: #fff;
    border: 1px solid rgba(255,255,255,0.3);
    font-size: 0.85rem;
    padding: 5px 14px;
    border-radius: var(--radius);
    background: transparent;
}
.tv-navbar .btn-signup:hover { border-color: #fff; color: #fff; }

.tv-navbar .dropdown-menu {
    background: #1a1a1a;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.tv-navbar .dropdown-item {
    color: #ccc;
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
}
.tv-navbar .dropdown-item:hover { background: var(--bg-hover); color: #fff; }
.tv-navbar .dropdown-divider { border-color: var(--border); }

/* =====================
   HERO BANNER
   ===================== */
.hero-banner {
    position: relative;
    min-height: 70vh;
    display: flex;
    align-items: flex-end;
    padding: 0 4%;
    padding-bottom: 6rem;
    padding-top: 80px;
    background-size: cover;
    background-position: center;
    background-color: #0a0a1a;
}
.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        0deg,
        var(--bg) 0%,
        rgba(20,20,20,0.7) 30%,
        rgba(20,20,20,0.3) 60%,
        rgba(20,20,20,0.1) 100%
    );
}
.hero-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(20,20,20,0.85) 0%, transparent 60%);
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 550px;
}
.hero-content .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 3px;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hero-content h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.6);
}
.hero-content p {
    font-size: 1.05rem;
    color: #ccc;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* =====================
   BUTTONS
   ===================== */
.btn-tv {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 24px;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}
.btn-tv-primary {
    background: #fff;
    color: #141414;
}
.btn-tv-primary:hover { background: #e0e0e0; color: #141414; }

.btn-tv-secondary {
    background: rgba(109,109,110,0.7);
    color: #fff;
}
.btn-tv-secondary:hover { background: rgba(109,109,110,0.5); }

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

/* =====================
   CHANNEL ROW (Horizontal Scroll)
   ===================== */
.channel-section {
    padding: 0 4%;
    margin-bottom: 2.5rem;
}
.channel-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.channel-section-title .live-dot {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: livePulse 1.5s infinite;
}

.channel-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 8px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.channel-row::-webkit-scrollbar { display: none; }

/* =====================
   CHANNEL CARD
   ===================== */
.ch-card {
    flex: 0 0 220px;
    scroll-snap-align: start;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    transition: var(--transition);
    cursor: pointer;
}
.ch-card:hover {
    transform: scale(1.08);
    z-index: 5;
    box-shadow: 0 8px 30px rgba(0,0,0,0.7);
}

.ch-card-thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e, #2d1b4e);
}
.ch-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.ch-card:hover .ch-card-thumb img { transform: scale(1.1); }

.ch-card-thumb .placeholder-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255,255,255,0.2);
}

/* Badges on cards */
.ch-badge {
    position: absolute;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    z-index: 2;
}
.ch-badge-live {
    top: 8px;
    left: 8px;
    background: var(--accent);
    color: #fff;
    animation: livePulse 1.5s infinite;
}
.ch-badge-free {
    top: 8px;
    right: 8px;
    background: var(--green);
    color: #000;
}
.ch-badge-premium {
    top: 8px;
    right: 8px;
    background: var(--gold);
    color: #000;
}
.ch-badge-external {
    top: 8px;
    right: 8px;
    background: var(--blue);
    color: #fff;
}

/* Card info overlay */
.ch-card-info {
    padding: 10px;
}
.ch-card-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ch-card-info .ch-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.ch-card-link {
    position: absolute;
    inset: 0;
    z-index: 3;
}

/* =====================
   CHANNEL GRID (Browse page)
   ===================== */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.channel-grid .ch-card {
    flex: none;
    width: 100%;
}

/* =====================
   CATEGORY PILLS
   ===================== */
.category-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.category-pills::-webkit-scrollbar { display: none; }

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(255,255,255,0.06);
    color: #b3b3b3;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    cursor: pointer;
}
.cat-pill:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.cat-pill.active {
    background: #fff;
    color: #141414;
    font-weight: 600;
}

/* =====================
   SEARCH BAR
   ===================== */
.tv-search {
    position: relative;
    max-width: 400px;
}
.tv-search input {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    color: #fff;
    padding: 8px 12px 8px 36px;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: var(--transition);
}
.tv-search input:focus {
    outline: none;
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
}
.tv-search input::placeholder { color: #666; }
.tv-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 0.8rem;
}

/* =====================
   FOOTER
   ===================== */
.tv-footer {
    padding: 3rem 4% 1.5rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
}
.tv-footer a { color: var(--text-muted); }
.tv-footer a:hover { color: var(--text); }
.tv-footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

/* =====================
   CTA Section
   ===================== */
.cta-section {
    text-align: center;
    padding: 4rem 4%;
    background: linear-gradient(180deg, var(--bg) 0%, var(--bg-surface) 100%);
    border-radius: var(--radius-lg);
    margin: 2rem 4%;
}
.cta-section h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
}
.cta-section p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 1.5rem;
}

/* =====================
   Empty State
   ===================== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; display: block; opacity: 0.3; }
.empty-state h3 { color: var(--text); font-size: 1.2rem; margin-bottom: 0.5rem; }

/* =====================
   ANIMATIONS
   ===================== */
@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* =====================
   UTILITIES
   ===================== */
.text-accent { color: var(--accent) !important; }
.bg-surface { background: var(--bg-surface); }
.pt-navbar { padding-top: 70px; }

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 768px) {
    .hero-banner {
        min-height: 55vh;
        padding-bottom: 3rem;
    }
    .hero-content h1 { font-size: 1.8rem; }
    .hero-content p { font-size: 0.9rem; }
    .ch-card { flex: 0 0 160px; }
    .channel-section-title { font-size: 1.1rem; }
    .channel-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    .channel-section { padding: 0 3%; }
}

@media (max-width: 480px) {
    .hero-banner { min-height: 45vh; }
    .hero-content h1 { font-size: 1.4rem; }
    .ch-card { flex: 0 0 140px; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn-tv { width: 100%; justify-content: center; }
}
