:root {
    --bg-main: #090d16;
    --bg-panel: #111827;
    --bg-card: #1e293b;
    --accent: #ef4444;
    --accent-glow: rgba(239, 68, 68, 0.35);
    --blue: #3b82f6;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; scroll-behavior: smooth; }
body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text);
    line-height: 1.5;
}

.container { max-width: 1340px; margin: 0 auto; padding: 0 20px; }

/* Header IPTV */
.header {
    background: rgba(17, 24, 39, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.logo-badge {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.logo h1 { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.4px; }
.logo small { display: block; font-size: 0.74rem; color: var(--muted); }

.search-box {
    position: relative;
    flex: 1;
    max-width: 380px;
}

.search-box input {
    width: 100%;
    background: #090d16;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 10px 14px 10px 38px;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
}

.search-box input:focus { border-color: var(--blue); }
.search-box i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 8px #ef4444;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.5; }
    100% { transform: scale(0.95); opacity: 1; }
}

/* Teatro / Player Principal */
.theater-section {
    padding: 24px 0 10px;
}

.theater-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.45);
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

.video-wrapper iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.now-playing-sidebar {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(9, 13, 22, 0.6);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
}

.np-badge {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 9px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.now-playing-sidebar h2 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    line-height: 1.3;
}

.now-playing-sidebar p {
    font-size: 0.88rem;
    color: var(--muted);
    margin-bottom: 16px;
}

.quick-zapping {
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.quick-zapping h4 {
    font-size: 0.82rem;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 10px;
}

.zapping-btns {
    display: flex;
    gap: 10px;
}

.btn-zap {
    flex: 1;
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 10px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.btn-zap:hover {
    background: var(--blue);
    border-color: var(--blue);
}

/* Abas de Categorias */
.categories-bar {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 22px 0 14px;
}

.cat-pill {
    background: var(--bg-panel);
    color: var(--muted);
    border: 1px solid var(--border);
    padding: 9px 18px;
    border-radius: 30px;
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.cat-pill:hover, .cat-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* Grade de Canais */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 18px;
    padding-bottom: 60px;
}

.channel-card {
    background: var(--bg-panel);
    border: 2px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.channel-card:hover, .channel-card.active-channel {
    transform: translateY(-4px);
    border-color: var(--accent);
    box-shadow: 0 12px 24px rgba(0,0,0,0.4);
}

.channel-thumb {
    position: relative;
    height: 148px;
    background: #000;
    overflow: hidden;
}

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

.channel-card:hover .channel-thumb img {
    transform: scale(1.06);
    opacity: 1;
}

.ch-num {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(9, 13, 22, 0.85);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.15);
}

.ch-live-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 4px;
}

.play-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    opacity: 0;
    transition: opacity 0.2s;
    font-size: 2.4rem;
    color: #fff;
}

.channel-card:hover .play-hover { opacity: 1; }

.channel-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.ch-cat {
    font-size: 0.73rem;
    color: #38bdf8;
    font-weight: 700;
    text-transform: uppercase;
}

.channel-body h3 {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}

.channel-body p {
    font-size: 0.8rem;
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Rodapé com Cadeado Discreto */
.footer {
    background: #05080f;
    border-top: 1px solid var(--border);
    padding: 25px 0;
    font-size: 0.82rem;
    color: var(--muted);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cadeado-discreto {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.2s;
}

.cadeado-discreto:hover { color: var(--muted); }

@media (max-width: 960px) {
    .theater-grid { grid-template-columns: 1fr; }
}