:root {
    --bg-dark: #07090e;
    --card-dark: rgba(14, 19, 29, 0.65); /* Transparencia para efecto cristal */
    --border-dark: rgba(31, 41, 61, 0.6);
    --accent-cyan: #00d2ff;
    --accent-blue: #3a7bd5;
    --accent-glow: rgba(0, 210, 255, 0.35);
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

/* === FONDO ANIMADO DEGRADADO === */
body {
    /* Tonos más vibrantes: Azul profundo, violeta oscuro y toques ámbar */
    background: linear-gradient(135deg, #0a1128, #1c0f24, #1a1405, #0a1128);
    background-size: 300% 300%;
    animation: animarFondo 15s ease infinite;
    color: var(--text-main);
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh; /* Asegura que el color cubra toda la altura de la pantalla */
}

@keyframes animarFondo {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* === EFECTO DE BRASAS/PARTÍCULAS === */
#particles-container {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ember {
    position: absolute;
    bottom: -20px;
    background: radial-gradient(circle, rgba(255, 170, 0, 0.8) 0%, rgba(255, 70, 0, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: floatUp infinite linear;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
}

@keyframes floatUp {
    0% { transform: translateY(0) scale(1); opacity: 0; }
    10% { opacity: 1; }
    80% { opacity: 1; }
    100% { transform: translateY(-100vh) scale(0.3); opacity: 0; }
}

.hidden { display: none !important; }

/* === PANTALLA DE INICIO (Landing) === */
#landing-screen {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    /* Reducimos la opacidad y el desenfoque para que el fondo brille a través de la capa */
    background: rgba(10, 15, 30, 0.2); 
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px); /* Soporte adicional para navegadores móviles */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.8s ease;
}

.landing-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    max-width: 90%;
}

#main-logo {
    width: 220px; height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-cyan);
    box-shadow: 0 0 35px var(--accent-glow);
}

.btn-primary {
    padding: 14px 36px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    border: none;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 0 20px var(--accent-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.06);
    box-shadow: 0 0 30px rgba(0, 210, 255, 0.6);
}

.affiliate-container {
    position: absolute;
    right: 35px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.affiliate-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(14, 19, 29, 0.85);
    backdrop-filter: blur(10px);
    padding: 12px 22px;
    border-radius: 14px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    border: 1px solid var(--border-dark);
    transition: transform 0.3s ease;
}

.affiliate-btn:hover {
    transform: scale(1.05);
}

.affiliate-logo {
    width: 28px; height: 28px;
    border-radius: 6px;
    object-fit: cover;
}

/* === HEADER Y ADSTERRA === */
#main-content {
    position: relative;
    z-index: 10;
}

header {
    text-align: center;
    padding: 18px 0;
    background: var(--card-dark);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border-dark);
}

.header-logo {
    height: 75px;
    border-radius: 12px;
}

.adsterra-banner-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 4px 0;
    background: #0e131d;
    border-bottom: 1px solid #1f293d;
}
.adsterra-banner-container {
    max-width: 970px;
    width: 100%;
    display: flex;
    justify-content: center;
    min-height: 30px;
    overflow: hidden;
}

/* === LAYOUT CENTRAL Y COLUMNA IZQUIERDA === */
.layout-container {
    display: flex;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 15px;
    gap: 20px;
    align-items: flex-start;
}

.sidebar {
    width: 250px;
    background: var(--card-dark);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 22px 18px;
    border-radius: 16px;
    border: 1px solid var(--border-dark);
    position: sticky;
    top: 20px;
    display: flex;
    flex-direction: column;
    z-index: 50;
}

.sidebar-title {
    text-align: center;
    margin-bottom: 18px;
    color: var(--accent-cyan);
}

#tested-apps-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.app-test-btn, .btn-patreon {
    display: block;
    padding: 13px 16px;
    text-align: center;
    text-decoration: none;
    color: #ffffff;
    border-radius: 10px;
    font-weight: 600;
}

.app-test-btn {
    background: linear-gradient(135deg, rgba(19, 27, 42, 0.8), rgba(26, 37, 58, 0.8));
    border: 1px solid var(--border-dark);
}

.btn-patreon { background: #ff424d; margin-top: 20px; }

/* === REDES SOCIALES FLOTANTES === */
.floating-socials {
    position: fixed;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.social-btn-circle {
    width: 50px; height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    font-size: 1.5rem;
    text-decoration: none;
    border: 1px solid var(--border-dark);
    background: rgba(20, 28, 44, 0.8);
    backdrop-filter: blur(8px);
}

.social-btn-circle.youtube { background: rgba(255, 0, 0, 0.8); border-color: #FF0000; }
.social-btn-circle.tiktok { background: rgba(0, 0, 0, 0.8); border-color: #00f2fe; }
.social-btn-circle.facebook { background: rgba(24, 119, 242, 0.8); border-color: #1877f2; }
.social-btn-circle.instagram { background: linear-gradient(45deg, rgba(240, 148, 51, 0.8), rgba(220, 39, 67, 0.8), rgba(188, 24, 136, 0.8)); border: none; }

/* === CONTENIDO CENTRAL === */
.content-area {
    flex: 1;
    background: var(--card-dark);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 18px;
    border: 1px solid var(--border-dark);
    padding: 25px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: rgba(18, 24, 36, 0.8);
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    color: #fff;
    border-color: transparent;
}

.tab-content h2 { text-align: center; margin-bottom: 10px; }
.tab-description { text-align: center; margin-bottom: 20px; color: var(--text-muted); }

/* === SECCIÓN ANÁLISIS === */
.analysis-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.analysis-app-btn {
    padding: 8px 18px;
    background: rgba(19, 26, 39, 0.8);
    color: var(--text-main);
    border: 1px solid var(--border-dark);
    border-radius: 8px;
    cursor: pointer;
}

.analysis-app-btn.active {
    background: rgba(25, 38, 58, 0.9);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.charts-card {
    background: rgba(9, 13, 20, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-dark);
    border-radius: 14px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100%, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    width: 100%;
}

.chart-box {
    background: rgba(16, 22, 35, 0.7);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border-dark);
    width: 100%;
    min-width: 0;
}

.canvas-wrapper { position: relative; width: 100%; height: 250px; }

.data-table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 20px;
}

.data-table {
    width: 100%;
    min-width: 450px;
    border-collapse: collapse;
    background: rgba(16, 22, 35, 0.6);
}

.data-table th, .data-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-dark);
}

.data-table th { color: var(--accent-cyan); }

/* === SECCIÓN PRODUCTOS ALIEXPRESS === */
.filter-container {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 22px;
    background: rgba(19, 26, 39, 0.8);
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.filter-btn:hover { color: #fff; border-color: #ff4747; }
.filter-btn.active { background: #ff4747; color: #fff; border-color: transparent; box-shadow: 0 0 15px rgba(255, 71, 71, 0.4); }

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.product-card {
    background: rgba(16, 22, 35, 0.75);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-dark);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.product-card:hover { transform: translateY(-6px); border-color: #ff4747; }
.product-img { width: 100%; height: 180px; object-fit: cover; border-radius: 8px; margin-bottom: 15px; background: rgba(9, 13, 20, 0.8); }
.product-title { font-size: 1.05rem; color: #e6edf3; margin-bottom: 18px; flex-grow: 1; }

.btn-comprar {
    display: block;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #ff4747, #ff7043);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    transition: all 0.3s ease;
}
.btn-comprar:hover { box-shadow: 0 5px 15px rgba(255, 71, 71, 0.5); transform: scale(1.02); }

@media (min-width: 768px) { .charts-grid { grid-template-columns: 1fr 1.3fr; } }

/* === MODAL DE PRODUCTO === */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

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

.modal-content {
    background: var(--card-dark);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-dark);
    border-radius: 18px;
    max-width: 620px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.modal-overlay.active .modal-content { transform: translateY(0) scale(1); opacity: 1; }
.modal-close {
    position: absolute; top: 12px; right: 12px; width: 36px; height: 36px;
    border-radius: 50%; border: 1px solid var(--border-dark); background: rgba(18, 24, 36, 0.8);
    color: var(--text-main); font-size: 1rem; cursor: pointer; display: flex;
    align-items: center; justify-content: center; transition: background 0.3s ease, transform 0.3s ease; z-index: 10;
}
.modal-close:hover { background: #ff4747; transform: rotate(90deg); }
.modal-gallery { margin-bottom: 20px; }
.modal-img-main { width: 100%; height: 300px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border-dark); background: #090d14; }
.modal-thumbnails { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; padding-bottom: 5px; }
.modal-thumb { width: 70px; height: 70px; object-fit: cover; border-radius: 8px; border: 2px solid var(--border-dark); cursor: pointer; transition: border-color 0.3s ease, transform 0.3s ease; flex-shrink: 0; }
.modal-thumb:hover { transform: scale(1.05); }
.modal-thumb.active { border-color: var(--accent-cyan); }
.modal-info h3 { color: var(--text-main); font-size: 1.3rem; margin-bottom: 12px; }
.modal-info p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin-bottom: 20px; }
/* === MINICÓMICS === */
.comics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px 0;
}
.comic-card {
    background: #131c2e;
    border: 1px solid #1f293d;
    border-radius: 16px;
    overflow: hidden;
    text-align: center;
}
.comic-portada {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
}
.comic-card h3 {
    color: #e6edf3;
    font-size: 1rem;
    padding: 10px;
}
.btn-leer-comic {
    width: 100%;
    padding: 12px;
    border: none;
    background: #00d2ff;
    color: #0e131d;
    font-weight: 700;
    cursor: pointer;
}
.comic-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}
.comic-viewer {
    background: #0e131d;
    border: 1px solid #1f293d;
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 16px;
}
.comic-viewer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.comic-viewer-header h3 { color: #e6edf3; }
.btn-cerrar-comic {
    background: #f472b6;
    color: #0e131d;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}
.comic-pages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.comic-pagina {
    width: 100%;
    border-radius: 10px;
}
.btn-ver-producto {
    display: block;
    text-align: center;
    margin-top: 14px;
    padding: 12px;
    background: #3a7bd5;
    color: #fff;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 700;
}
/* === RESPONSIVE === */
@media (max-width: 900px) {
    .layout-container { flex-direction: column; padding: 10px; }
    .sidebar { width: 100%; position: relative; top: 0; flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 15px; }
    #tested-apps-container { flex-direction: row; flex-wrap: wrap; width: 100%; justify-content: center; }
    .sidebar-title { display: none; }
    .app-test-btn, .btn-patreon { flex: 1 1 150px; font-size: 1.05rem; padding: 15px; }
    .content-area { padding: 15px; }
    p, .tab-description, .data-table td { font-size: 1.05rem; }
    .modal-img-main { height: 220px; }
}
@media (max-width: 768px) {
    .affiliate-container { position: relative; right: 0; margin-top: 20px; flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .floating-socials { right: 8px; }
    .social-btn-circle { width: 45px; height: 45px; font-size: 1.2rem; }
    .modal-content { padding: 20px; }
}

/* === SECCIÓN APLICACIÓN MÓVIL === */
.app-showcase { display: flex; gap: 30px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 20px 0; }
.app-phone { width: 220px; height: 450px; background: rgba(14, 19, 29, 0.8); backdrop-filter: blur(10px); border: 3px solid var(--border-dark); border-radius: 36px; padding: 12px; box-shadow: 0 20px 50px rgba(0, 210, 255, 0.15); position: relative; }
.app-phone::before { content: ''; position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: 60px; height: 5px; background: var(--border-dark); border-radius: 10px; }
.app-phone-img { width: 100%; height: 100%; object-fit: cover; border-radius: 26px; }
.app-info { max-width: 380px; text-align: left; }
.app-info h3 { color: #00d2ff; font-size: 1.6rem; margin-bottom: 12px; }
.app-info p { color: #8b949e; line-height: 1.6; margin-bottom: 24px; }
.app-buttons { display: flex; flex-direction: column; gap: 12px; }
.btn-download-web, .btn-download-store { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 20px; border-radius: 12px; font-weight: 700; text-decoration: none; transition: transform 0.3s, box-shadow 0.3s; }
.btn-download-web { background: linear-gradient(135deg, #3a7bd5, #00d2ff); color: #fff; box-shadow: 0 6px 20px rgba(0, 210, 255, 0.3); }
.btn-download-store { background: rgba(26, 37, 58, 0.8); color: #8b949e; border: 1px solid var(--border-dark); cursor: not-allowed; }
.btn-download-web:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0, 210, 255, 0.5); }
@media (max-width: 600px) { .app-phone { width: 180px; height: 370px; } }