/* =========================================
   1. VARIABLES DEL SISTEMA (Design Tokens)
   ========================================= */
:root {
    --bg-deep: #030712;
    --bg-card: #0b1120;
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.3);
    --secondary: #a855f7;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-light: rgba(255, 255, 255, 0.08);
    --shadow-premium: 0 20px 40px rgba(0, 0, 0, 0.4);
    --transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* =========================================
   2. CONFIGURACIÓN BASE Y RESET
   ========================================= */
* {
    margin: 0; padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Plus Jakarta Sans', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.glow-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(circle at 50% -20%, #1e1b4b 0%, transparent 50%);
    z-index: -1;
    animation: pulse-bg 10s infinite alternate; /* Fondo vivo sutil */
}

@keyframes pulse-bg {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

/* =========================================
   3. NAVEGACIÓN Y HEADER
   ========================================= */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 0;
    /* Animación de entrada */
    opacity: 0;
    animation: pageLoad 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.logo { font-weight: 800; font-size: 1.4rem; letter-spacing: -1px; }
.logo span {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: 0.3s;
}

.btn-submit-nav {
    background: var(--primary);
    padding: 10px 22px;
    border-radius: 12px;
    color: white !important;
    font-weight: 700 !important;
    transition: 0.3s;
    border: none;
    cursor: pointer;
}

.btn-submit-nav:hover {
    background: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--primary-glow);
}

.hero-content { text-align: center; padding: 60px 0; }
.announcement {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    padding: 8px 18px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid rgba(99, 102, 241, 0.2);
    /* Animación */
    opacity: 0;
    animation: pageLoad 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s forwards;
}

h1 { 
    font-size: clamp(2.5rem, 5vw, 4rem); 
    margin: 25px 0; 
    letter-spacing: -2px; 
    /* Animación */
    opacity: 0;
    animation: pageLoad 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.2s forwards;
}
h1 span { color: var(--primary); }

/* =========================================
   4. COMPONENTES (Buscador, Voz y Filtros)
   ========================================= */
.search-box { 
    position: relative; 
    max-width: 550px; 
    margin: 0 auto; 
    /* Animación */
    opacity: 0;
    animation: pageLoad 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s forwards;
}

.search-icon {
    position: absolute; left: 20px; top: 50%;
    transform: translateY(-50%); color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 22px 60px 22px 55px; 
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.03);
    color: white;
    font-size: 1.05rem;
    backdrop-filter: blur(10px);
    outline: none;
    transition: 0.3s;
}

.search-box input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 30px var(--primary-glow);
}

.voice-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    transition: 0.3s;
    z-index: 10;
}

.voice-btn.active {
    color: #ef4444; 
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% { transform: translateY(-50%) scale(1); }
    70% { transform: translateY(-50%) scale(1.2); text-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
    100% { transform: translateY(-50%) scale(1); }
}

.filter-group { 
    display: flex; 
    justify-content: center; 
    gap: 12px; 
    margin-top: 40px; 
    flex-wrap: wrap; 
    /* Animación */
    opacity: 0;
    animation: pageLoad 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s forwards;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 14px;
    cursor: pointer;
    transition: 0.3s;
    font-weight: 600;
}

.filter-btn.active, .filter-btn:hover {
    background: white; color: black;
    border-color: white; transform: translateY(-2px);
}

/* =========================================
   5. GRILLA Y CARDS (CON ANIMACIONES PREMIUM)
   ========================================= */
.grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); 
    gap: 30px; 
    margin-top: 40px; 
}

/* Base de la Tarjeta */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 28px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden; /* Importante para el efecto de destello */
    z-index: 1;
}

/* Efecto de Resplandor (Glow) al Hover */
.card:hover {
    transform: translateY(-12px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 
        0 15px 30px rgba(0, 0, 0, 0.5),      /* Sombra base */
        0 0 20px rgba(99, 102, 241, 0.2),    /* Brillo interior suave */
        0 0 40px rgba(99, 102, 241, 0.15);   /* Resplandor exterior */
}

/* Efecto "Destello" (Sheen) metálico que cruza la tarjeta */
.card::after {
    content: "";
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transition: 0.5s;
    pointer-events: none;
}

.card:hover::after {
    left: 100%;
    transition: 0.7s ease-in-out;
}

/* Icono Flotante */
.card-icon {
    width: 55px; height: 55px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 15px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: white; margin-bottom: 20px;
    transition: 0.4s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.card:hover .card-icon {
    transform: translateY(-5px) rotate(5deg);
    box-shadow: 0 10px 20px var(--primary-glow);
    background: linear-gradient(135deg, var(--secondary), var(--primary));
}

/* Botón Reactivo */
.btn-card {
    margin-top: auto; 
    padding: 14px; 
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: white; 
    text-align: center; 
    text-decoration: none;
    font-weight: 700; 
    transition: 0.3s;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.card:hover .btn-card {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* Animación de entrada inicial (usada por JS) */
@keyframes modalAppear {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* =========================================
   6. SECCIÓN DE TUTORIALES
   ========================================= */
.tutorials-section { margin: 80px auto; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { font-size: 2.5rem; margin-top: 15px; }

.tutorials-container {
    background: var(--bg-card);
    border-radius: 32px;
    padding: 40px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-premium);
}

.tutorial-tabs {
    display: flex; gap: 15px;
    margin-bottom: 35px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
    overflow-x: auto;
}

.tab-btn {
    background: transparent; border: none;
    color: var(--text-muted); padding: 10px 25px;
    font-weight: 700; cursor: pointer; transition: 0.3s;
    font-size: 1rem; border-radius: 10px;
}

.tab-btn.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.tab-content { display: none; animation: fadeIn 0.5s ease forwards; }
.tab-content.active { display: block; }

.step {
    display: flex; align-items: flex-start; gap: 20px;
    margin-bottom: 20px; padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 18px; border: 1px solid transparent;
    transition: 0.3s;
}

.step:hover { border-color: var(--border-light); background: rgba(255, 255, 255, 0.04); }

.step span {
    background: var(--primary);
    min-width: 35px; height: 35px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-weight: 800; font-size: 0.9rem; color: white;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   7. NEWSLETTER Y MODAL
   ========================================= */
.newsletter-section { margin: 100px 0; }
.newsletter-card {
    background: linear-gradient(135deg, #0f172a 0%, #030712 100%);
    padding: 60px 40px; border-radius: 40px;
    text-align: center; border: 1px solid var(--border-light);
    box-shadow: var(--shadow-premium);
}

.newsletter-form { display: flex; gap: 12px; max-width: 550px; margin: 0 auto; }
.newsletter-form input {
    flex: 1; padding: 16px 20px; border-radius: 14px;
    background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-light);
    color: white; outline: none;
}

.newsletter-form button {
    padding: 16px 28px; border-radius: 14px; border: none;
    background: white; color: black; font-weight: 800; cursor: pointer;
}

.modal-overlay {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(3, 7, 18, 0.9);
    backdrop-filter: blur(15px);
    display: none; justify-content: center; align-items: center; z-index: 2000;
}

.modal-content {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: 32px; padding: 40px; width: 90%; max-width: 480px;
    position: relative; animation: modalAppear 0.5s var(--transition);
}

/* =========================================
   8. SKELETON LOADER
   ========================================= */
.skeleton-card {
    background: var(--bg-card); border-radius: 28px;
    padding: 30px; height: 320px; border: 1px solid var(--border-light);
    display: flex; flex-direction: column; gap: 20px;
    position: relative; overflow: hidden;
}

.skeleton-item {
    background: linear-gradient(90deg, #0b1120 25%, #1e293b 50%, #0b1120 75%);
    background-size: 200% 100%; animation: skeleton-loading 1.5s infinite linear;
    border-radius: 12px;
}

.skeleton-icon { width: 55px; height: 55px; border-radius: 15px; }
.skeleton-title { width: 50%; height: 24px; }
.skeleton-text { width: 100%; height: 60px; }
.skeleton-btn { width: 100%; height: 48px; margin-top: auto; }

@keyframes skeleton-loading {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* =========================================
   9. MEJORAS DE CURSOR Y UX
   ========================================= */
body, .card, .step, .logo, .nav-links a, 
.announcement, .section-header h2, 
.hero-content p, .results-header h2 {
    cursor: default;
    user-select: none;
}

.filter-btn, .tab-btn, .btn-card, 
.btn-submit-nav, .voice-btn, .close-modal, 
.newsletter-form button, .btn-primary-full {
    cursor: pointer !important;
}

input, textarea {
    cursor: text;
    user-select: auto;
}

.logo, .filter-btn, .tab-btn, .btn-submit-nav {
    -webkit-user-drag: none;
}

/* =========================================
   10. ANIMACIONES DE CARGA (PAGE LOAD)
   ========================================= */
@keyframes pageLoad {
    0% { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    100% { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* =========================================
   11. RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .nav-links { display: none; }
    h1 { font-size: 2.5rem; }
    .grid { grid-template-columns: 1fr; }
    .newsletter-form { flex-direction: column; }
    .tutorial-tabs { justify-content: flex-start; }
}