/* ==========================================================================
   1. VARIÁVEIS GLOBAIS & CONFIGURAÇÕES (Design System)
   ========================================================================== */
:root {
    /* Paleta de Cores - Dark/Neon Theme */
    --primary-color: #6366f1;       /* Indigo Vibrante */
    --primary-hover: #4f46e5;
    --secondary-color: #ec4899;     /* Rosa/Magenta Neon */
    --accent-color: #fbbf24;        /* Dourado para destaques/badges */
    
    /* Backgrounds */
    --bg-body: #0f172a;             /* Azul Noite Profundo */
    --bg-card: #1e293b;             /* Azul Petróleo Escuro */
    --bg-card-hover: #26334d;
    --bg-input: #020617;
    
    /* Textos */
    --text-main: #f8fafc;           /* Branco Gelo */
    --text-muted: #94a3b8;          /* Cinza Azulado */
    --text-highlight: #38bdf8;      /* Azul Claro Neon */

    /* Gradientes */
    --gradient-main: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    --gradient-card: linear-gradient(180deg, rgba(30, 41, 59, 0) 0%, rgba(30, 41, 59, 0.9) 100%);
    --gradient-gold: linear-gradient(90deg, #f59e0b, #fbbf24);

    /* Espaçamentos e Bordas */
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 20px;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-neon: 0 0 15px rgba(99, 102, 241, 0.3);
    
    /* Fontes */
    --font-main: 'Poppins', sans-serif;
    --font-mono: 'Courier New', Courier, monospace; /* Para o MAC */

    /* Dimensões */
    --header-height: 80px;
    --container-width: 1200px;
}

/* ==========================================================================
   2. RESET & BASE
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/*
 * Botão flutuante do WhatsApp
 * Exibe um ícone de WhatsApp fixo no canto inferior direito da tela.
 * Utiliza uma animação de pulsar para chamar a atenção do usuário.
 */
.whatsapp-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: whatsapp-pulse 2s infinite;
}

@keyframes whatsapp-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Container Global */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ==========================================================================
   3. HEADER & NAVEGAÇÃO
   ========================================================================== */
.main-header {
    background: rgba(15, 23, 42, 0.85); /* Vidro fosco */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo-img {
    height: 50px; /* Ajuste conforme sua logo */
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

/* Navegação Desktop */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 30px;
}

.desktop-nav ul {
    display: flex;
    gap: 25px;
}

.desktop-nav a {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.95rem;
    position: relative;
}

.desktop-nav a:hover,
.desktop-nav a.active {
    color: var(--text-main);
}

.desktop-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: var(--gradient-main);
    transition: width 0.3s;
}

.desktop-nav a:hover::after {
    width: 100%;
}

/* Botão de Login (Admin) */
.btn-login {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-login:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Menu Mobile (Hamburguer) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav {
    position: fixed;
    top: 0;
    right: -100%; /* Escondido por padrão */
    width: 280px;
    height: 100vh;
    background: var(--bg-card);
    z-index: 1001;
    padding: 20px;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.5);
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav.active {
    right: 0;
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav-header img {
    height: 40px;
}

.mobile-nav-header button {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.mobile-nav ul li {
    margin-bottom: 20px;
}

.mobile-nav a {
    font-size: 1.1rem;
    color: var(--text-main);
    display: block;
    padding: 10px;
    border-radius: var(--border-radius-sm);
}

.mobile-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--primary-color);
}

/* ==========================================================================
   4. HERO SECTION (Banner)
   ========================================================================== */
.hero-section {
    position: relative;
    padding: 100px 0 60px;
    text-align: center;
    background: radial-gradient(circle at top center, rgba(99, 102, 241, 0.15) 0%, rgba(15, 23, 42, 0) 70%);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Adicione uma imagem de fundo sutil aqui se quiser */
    background-image: url('grid-pattern.png'); /* Opcional: padrão de grid */
    opacity: 0.05;
    z-index: -1;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 15px;
    line-height: 1.2;
}

.text-highlight {
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 40px;
}

/* Search Bar Estilizada */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
    pointer-events: none;
}

#appSearch {
    width: 100%;
    padding: 18px 20px 18px 55px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-main);
    font-size: 1rem;
    transition: all 0.3s;
    font-family: var(--font-main);
}

#appSearch:focus {
    background: rgba(0, 0, 0, 0.5);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

#appSearch::placeholder {
    color: rgba(148, 163, 184, 0.6);
}

/* ==========================================================================
   5. GRID DE APLICATIVOS (Layout Principal)
   ========================================================================== */
.apps-section {
    padding: 60px 0;
    background: var(--bg-body);
}

.section-title {
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

.section-title h2 {
    font-size: 1.8rem;
    font-weight: 600;
}

.title-bar {
    width: 50%;
    height: 4px;
    background: var(--gradient-main);
    margin-top: 8px;
    border-radius: 2px;
}

.apps-grid {
    display: grid;
    /* Responsividade automática: Cards encolhem até 240px */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
}

/* CARD DO APP */
.app-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}

.app-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-neon);
    border-color: rgba(99, 102, 241, 0.4);
    z-index: 2;
}

/* Cabeçalho do Card (Imagem + Badge) */
.card-header {
    position: relative;
    padding: 20px;
    background: radial-gradient(circle at center, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 70%);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 160px;
}

.img-wrapper {
    width: 100px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    /*
     * Adicionamos um espaçamento superior no contêiner da imagem dos
     * cards para evitar que ela fique por cima da badge "Ativação
     * Instantânea". Sem esse espaçamento, a borda superior do logotipo
     * invadia a etiqueta, dificultando a leitura. Esse margin-top
     * empurra a imagem para baixo de forma consistente em todos os cards.
     */
    margin-top: 20px;
}

.img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.5));
    transition: transform 0.3s;
}

.app-card:hover .img-wrapper img {
    transform: scale(1.1);
}

/* Badge (Ativação Instantânea) */
.badge-instant {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: var(--accent-color);
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid var(--accent-color);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Corpo do Card */
.card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
}

.app-name {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.price-tag {
    text-align: center;
    margin-bottom: 15px;
    background: rgba(255, 255, 255, 0.05);
    padding: 5px;
    border-radius: var(--border-radius-sm);
}

.price-tag .currency {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.price-tag .value {
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.3rem;
}

/* Botões do Card */
.card-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Botão Detalhes (Outline) */
.btn-details {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-muted);
    padding: 8px;
    border-radius: 50px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-details:hover {
    border-color: var(--text-main);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

/* Botão Ativar (Gradient) */
.btn-activate {
    background: var(--gradient-main);
    border: none;
    color: white;
    padding: 10px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: filter 0.3s, transform 0.2s;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.btn-activate:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.5);
}

/* Estados de Busca Vazia */
.no-results, .no-search-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--border-radius-md);
    border: 2px dashed rgba(255, 255, 255, 0.1);
}

.no-results i, .no-search-results i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* ==========================================================================
   6. FEATURES & FOOTER
   ========================================================================== */
.features-section {
    padding: 60px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: #0b0f19;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.feature-box {
    text-align: center;
    padding: 30px;
    background: var(--bg-card);
    border-radius: var(--border-radius-md);
    transition: transform 0.3s;
}

.feature-box i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.feature-box h3 {
    margin-bottom: 10px;
    color: var(--text-main);
}

.feature-box p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Footer */
.main-footer {
    background: #020617;
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

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

.footer-logo img {
    height: 35px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.footer-logo p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    font-size: 1.1rem;
    transition: all 0.3s;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: rotate(10deg);
}

/* ==========================================================================
   7. MODAL (Ativação)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #1e293b;
    width: 90%;
    max-width: 450px;
    padding: 30px;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}

.modal-close:hover {
    color: var(--text-main);
}

.modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.modal-icon {
    width: 60px;
    height: 60px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    color: var(--primary-color);
    font-size: 1.8rem;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.modal-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Formulário do Modal */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-highlight);
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-wrapper input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    background: #0f172a;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--text-main);
    font-family: var(--font-mono); /* Fonte mono para MAC */
    font-size: 1.1rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: border-color 0.3s;
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.helper-text {
    display: block;
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.price-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.price-display {
    font-size: 1.2rem;
    font-weight: 700;
    color: #4ade80; /* Verde Dinheiro */
}

.btn-confirm-activation {
    width: 100%;
    padding: 15px;
    background: var(--gradient-main);
    border: none;
    border-radius: var(--border-radius-sm);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
}

.btn-confirm-activation:hover {
    opacity: 0.9;
    box-shadow: 0 5px 20px rgba(236, 72, 153, 0.4);
}

/* ==========================================================================
   8. MEDIA QUERIES (Responsividade)
   ========================================================================== */
@media (max-width: 992px) {
    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .apps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .apps-grid {
        grid-template-columns: 1fr; /* 1 card por linha no mobile pequeno */
    }
    
    .section-title h2 {
        font-size: 1.5rem;
    }
    
    #appSearch {
        font-size: 0.9rem;
        padding: 15px 15px 15px 45px;
    }
}

/* ==========================================================================
   9. CLASSES UTILITÁRIAS & ADMIN PREP (Futuro)
   ========================================================================== */
.admin-sidebar {
    background: var(--bg-card);
    width: 250px;
    height: 100vh;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.status-active {
    color: #4ade80;
}

.status-inactive {
    color: #f87171;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
}

.table-custom th, .table-custom td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}