<?php
session_start();
require_once 'includes/db.php';

// Verificação de segurança
if (!isset($_SESSION['logged_in_fxtream']) || $_SESSION['logged_in_fxtream'] !== true) {
    header('Location: index.php');
    exit;
}

$user_name = $_SESSION['username'] ?? 'Admin';
?>

<!DOCTYPE html>
<html lang="pt-br">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> 
    <title>Material de Ajuda</title>
    
    <link href="https://fonts.googleapis.com/css2?family=Poppins&display=swap" rel="stylesheet">
    <link rel="stylesheet" href="https://vendedorp2p.com/views/_css/bootstrap/bootstrap.min.css">
    <link rel="stylesheet" href="https://vendedorp2p.com/views/_css/bootstrap/mdb.min.css">
    <link rel="stylesheet" href="https://vendedorp2p.com/views/_css/style.css">
    <link rel="stylesheet" href="https://vendedorp2p.com/views/_fonts/font-awesome/css/all.min.css">
    <link rel="stylesheet" href="https://vendedorp2p.com/views/_css/dark-theme.css">
    
    <style>
        body { background-color: #1a1c23; color: #fff; }
        
        /* Estilos do Card de Ajuda */
        .card-help {
            background-color: #232730;
            border: none;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.3);
            margin-bottom: 20px;
        }
        .card-header-help {
            font-size: 1.5rem;
            font-weight: 600;
            padding: 20px;
            border-bottom: 1px solid #3a3f4b;
            text-transform: uppercase;
            color: #fff;
        }
        .help-content {
            padding: 25px;
            font-size: 0.95rem;
            line-height: 1.8;
            color: #ccc;
        }
        .help-title {
            color: #00c851;
            font-weight: bold;
            font-size: 1.1rem;
            margin-top: 20px;
            margin-bottom: 10px;
            display: block;
        }
        .help-subtitle {
            font-weight: 600;
            color: #fff;
            margin-top: 15px;
            display: block;
        }
        .help-link {
            color: #33b5e5;
            text-decoration: none;
            word-break: break-all;
        }
        .help-link:hover { color: #0099cc; text-decoration: underline; }
        .check-icon { color: #00c851; margin-right: 8px; }

        /* =========================================
           LÓGICA DE VISIBILIDADE DO MENU (O SEGREDO ESTÁ AQUI)
           ========================================= */
        
        /* CONFIGURAÇÃO PARA PC (Telas grandes) */
        @media (min-width: 992px) {
            #sidebar { 
                display: block !important; /* Força aparecer no PC */
                width: 240px; position: fixed; top: 0; left: 0; height: 100vh; z-index: 1000; overflow-y: auto;
            }
            .right-column { 
                margin-left: 240px; /* Empurra o conteúdo para não ficar baixo do menu */
                width: calc(100% - 240px); 
            }
            .btn-voltar-mobile { display: none; } /* Esconde botão de voltar no PC */
        }

        /* CONFIGURAÇÃO PARA CELULAR (Telas pequenas) */
        @media (max-width: 991px) {
            #sidebar { 
                display: none !important; /* ESCONDE O MENU LATERAL NO CELULAR */
            }
            .right-column { 
                margin-left: 0 !important; 
                width: 100% !important; 
                padding: 15px !important;
            }
            /* Esconde qualquer barra de navegação superior que tenha botões de menu */
            .navbar, .hamburger { display: none !important; }
            
            .btn-voltar-mobile {
                display: inline-block;
                margin-bottom: 15px;
                background: #333;
                color: #fff;
                padding: 8px 15px;
                border-radius: 5px;
                text-decoration: none;
            }
        }
    </style>
</head>

<body>

    <div class="container-fluid p-0"> 
        <div class="row no-gutters"> 
            
            <?php include 'includes/sidebar.php'; ?>

            <div class="right-column">
                
                <main class="main-content p-4">
                    
                    <a href="dashboard.php" class="btn-voltar-mobile"><i class="fas fa-arrow-left"></i> Voltar</a>

                    <div class="mb-4">
                        <h3 class="text-white">INFORMAÇÕES</h3>
                    </div>

                    <div class="card card-help">
                        <div class="card-header-help">
                            MATERIAL DE AJUDA
                        </div>
                        <div class="card-body help-content">
                            
                            <div class="mb-4">
                                <span class="help-title">
                                    <i class="fas fa-check-square"></i> <i class="fas fa-check-square"></i> <i class="fas fa-check-square"></i> 
                                    INFORMAÇÕES PARA O SISTEMA IPTV 
                                    <i class="fas fa-check-square"></i> <i class="fas fa-check-square"></i> <i class="fas fa-check-square"></i>
                                </span>
                                
                                <span class="help-subtitle">DNS PARA SMARTERS PLAYER IPTV | XCIPTV ENTRE OUTROS</span>
                                <div><i class="fas fa-check check-icon"></i> http://axr.topiptv.one:80</div>
                                <div><i class="fas fa-check check-icon"></i> http://axr.topiptv.one</div>
                            </div>

                            <div class="mt-2"><i class="fas fa-check check-icon"></i> BAY IPTV PRÓPRIO PRA SAMSUNG: <a href="https://cms.bayip.tv/" target="_blank" class="help-link">https://cms.bayip.tv/</a></div>

                            <hr style="border-color: #3a3f4b;">

                            <div class="mb-4">
                                <div class="mb-3">
                                    <i class="fas fa-check check-icon"></i> <strong>SMART IPTV</strong> (SITE PARA ADD LISTA)<br>
                                    <a href="https://siptv.eu/mylist/" target="_blank" class="help-link">https://siptv.eu/mylist/</a>
                                </div>

                                <div class="mb-3">
                                    <i class="fas fa-check check-icon"></i> <strong>SSIPTV</strong> (SITE PARA ADD LISTA)<br>
                                    <a href="https://ss-iptv.com/en/users/playlist" target="_blank" class="help-link">https://ss-iptv.com/en/users/playlist</a>
                                </div>

                                <div class="mb-3">
                                    <i class="fas fa-check check-icon"></i> <strong>DUPLEX PLAY</strong> (SITE PARA ADD LISTA)<br>
                                    <a href="http://edit.duplexplay.com/" target="_blank" class="help-link">http://edit.duplexplay.com/</a>
                                </div>
                                
                                <div class="mb-3">
                                    <i class="fas fa-check check-icon"></i> <strong>FLIX IPTV</strong> (SITE PARA ADD LISTA)<br>
                                    <a href="https://flixiptv.eu/mylist" target="_blank" class="help-link">https://flixiptv.eu/mylist</a>
                                </div>
                            </div>
                            
                            <hr style="border-color: #3a3f4b;">

                            <div class="mb-2">
                                <div class="mb-3">
                                    <i class="fas fa-check check-icon"></i> <strong>COMO ALTERAR DNS E INSTALAR O STB NA SMART TV LG</strong><br>
                                    <a href="https://youtu.be/zUImRaFN7Bc" target="_blank" class="help-link">https://youtu.be/zUImRaFN7Bc</a>
                                </div>

                                <div class="mb-3">
                                    <i class="fas fa-check check-icon"></i> <strong>COMO ALTERAR DNS NA SAMSUNG PARA USAR O STB</strong><br>
                                    <a href="https://youtu.be/fg5paElD4Xg" target="_blank" class="help-link">https://youtu.be/fg5paElD4Xg</a>
                                </div>

                                <div class="mb-3">
                                    <i class="fas fa-check check-icon"></i> <strong>INSTALAR O SMART IPTV NA SMARTTV SAMSUNG (VIA DNS)</strong><br>
                                    <a href="https://youtu.be/Qwl8-5n0tAA" target="_blank" class="help-link">https://youtu.be/Qwl8-5n0tAA</a>
                                </div>

                                <div class="mb-3">
                                    <i class="fas fa-check check-icon"></i> <strong>COMO INSTALAR O MEGASAT NA SMART TV SAMSUNG (SS IPTV)</strong><br>
                                    <a href="https://youtu.be/SWYols6gQaM" target="_blank" class="help-link">https://youtu.be/SWYols6gQaM</a>
                                </div>
                            </div>

                        </div>
                    </div>
                </main>
            </div>
        </div>
    </div>

    <script src="https://vendedorp2p.com/views/_js/jquery/jquery-3.1.1.min.js"></script>
    <script src="https://vendedorp2p.com/views/_js/bootstrap/bootstrap.min.js"></script>
    
</body>
</html>