/* =========================================
   1. VARIABLES Y CONFIGURACIÓN BASE (MODO TECH)
   ========================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Roboto+Mono:wght@400;700&display=swap');

:root { 
    /* Nuevos Colores Tecnológicos */
    --primary: #06B6D4;           /* Cian Eléctrico */
    --primary-light: #22D3EE;     /* Cian Brillante */
    --accent: #8B5CF6;            /* Violeta Neón para detalles */
    
    /* Configuración para fondo oscuro profundo */
    --dark: #F8FAFC;              /* Títulos claros */
    --light: #0F172A;             /* Fondo Azul Profundo (Slate 900) */
    --text: #CBD5E1;              /* Texto gris claro */
    --white: #1E293B;             /* Fondo de tarjetas (Slate 800) */
    --gray-light: rgba(255,255,255,0.05);
    --border: rgba(255,255,255,0.1);
    
    /* Sombras con "Gracia" y Brillo Neón */
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 0 20px rgba(6, 182, 212, 0.3); /* Resplandor cian */
}

* {
    box-sizing: border-box;
}

body { 
    font-family: 'Inter', sans-serif; 
    margin: 0; 
    color: var(--text); 
    background: var(--light); /* Fondo oscuro uniforme */
    line-height: 1.6; 
}

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

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

/* =========================================
   2. HEADER Y NAVEGACIÓN
   ========================================= */
header {
    background: rgba(15, 23, 42, 0.9); /* Translúcido tecnológico */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 10px;
    text-shadow: 0 0 12px rgba(6, 182, 212, 0.5);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Buscador Moderno */
.search-form {
    display: flex;
    background: var(--gray-light);
    border-radius: 8px;
    padding: 5px 15px;
    border: 1px solid var(--border);
}

.search-form:focus-within {
    border-color: var(--primary-light);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.search-form input {
    border: none;
    background: transparent;
    padding: 8px;
    outline: none;
    color: #fff;
}

/* Selector de Idiomas */
.lang-switcher a {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 4px;
    color: var(--text);
}

.lang-switcher a.active {
    background: var(--primary);
    color: var(--light);
}

/* Navegación de Categorías */
.cat-nav {
    background: var(--primary);
    padding: 10px 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.cat-list {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}

.cat-list::-webkit-scrollbar { display: none; }

.cat-list a {
    color: var(--light); /* Contraste oscuro sobre el fondo cian */
    font-size: 0.9rem;
    font-weight: 600;
}

.cat-list a:hover { color: #fff; }

/* =========================================
   3. GRID DE ARTÍCULOS (PORTADA)
   ========================================= */
.section-title {
    margin: 40px 0 20px;
    font-size: 1.8rem;
    color: var(--dark);
    font-family: 'Roboto Mono', monospace;
    letter-spacing: -1px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.card {
    background: var(--white); /* Fondo oscuro Slate 800 */
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    filter: brightness(0.85); /* Un poco más oscuro para que resalte el texto */
    transition: filter 0.3s ease;
}

.card:hover img {
    filter: brightness(1);
}

.card-body { padding: 20px; }

.card-body h2 {
    font-size: 1.2rem;
    margin: 0 0 10px;
    color: #fff; /* Título en blanco puro */
    line-height: 1.3;
    font-weight: 700;
}

.resumen-preview {
    font-size: 0.9rem;
    color: var(--primary-light); /* Texto resumen en cian neón */
    opacity: 0.9;
}

/* =========================================
   4. VISTA DE ARTÍCULO DETALLADO
   ========================================= */
.recipe-container {
    max-width: 850px;
    margin: 40px auto;
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.recipe-header img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
}

.recipe-content { 
    padding: 40px; 
    color: #fff; 
}

.badge-container { margin-bottom: 15px; }

.badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 8px;
}

.badge-cat { 
    background: rgba(6, 182, 212, 0.1); 
    color: var(--primary-light);
    border: 1px solid var(--primary);
}

/* Estilo Tip Rápido */
.resumen-box {
    background: rgba(6, 182, 212, 0.05);
    border-left: 5px solid var(--primary);
    padding: 25px;
    border-radius: 0 12px 12px 0;
    margin: 30px 0;
    color: var(--primary-light);
}

/* Estilo Ejemplo Práctico */
.ingredients-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed var(--border);
    padding: 30px;
    border-radius: 12px;
    margin: 40px 0;
}

.ingredients-box h3 { 
    color: var(--primary-light); 
    margin-top: 0; 
    font-family: 'Roboto Mono', monospace;
}

/* =========================================
   5. NAVEGACIÓN ENTRE ARTÍCULOS
   ========================================= */
.nav-wrapper {
    margin-top: 60px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    border-top: 1px solid var(--border);
    padding-top: 40px;
}

.nav-card {
    background: var(--white);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.nav-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: var(--shadow-hover);
}

.nav-card img {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
}

.nav-right {
    text-align: right;
    flex-direction: row-reverse;
}

.nav-right img {
    margin-right: 0;
    margin-left: 15px;
}

.nav-info {
    flex: 1;
}

.nav-label {
    font-family: 'Roboto Mono', monospace;
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 4px;
}

.nav-title {
    font-weight: 600;
    color: #fff;
    font-size: 1rem;
    line-height: 1.3;
}

/* =========================================
   6. PAGINACIÓN
   ========================================= */
.pagination {
    display: flex;
    justify-content: center;
    margin: 50px 0;
}

.pagination-wrapper {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: var(--gray-light);
    color: var(--primary-light);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.page-link.active {
    background: var(--primary);
    color: var(--light);
    border-color: var(--primary);
    pointer-events: none;
}

/* =========================================
   ESTILOS DE CONTENEDORES DE ANUNCIOS
   ========================================= */
.ad-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin: 20px auto; 
    padding: 0;
    overflow: hidden;
    min-height: 280px; 
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
}

.ad-container small,
.ad-container::before,
.ad-container::after {
    display: none !important;
}

ins.adsbygoogle[data-ad-status="unfilled"],
.ad-container:has(ins[data-ad-status="unfilled"]) {
    display: none !important;
}

.grid .ad-container {
    grid-column: span 1 !important;
}

/* =========================================
   FAQ & AI CONTEXT
   ========================================= */
.faq-ai-container {
    width: 100%;
    max-width: 800px;
    margin: 40px auto;
}

.faq-ai-details {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    color: #fff;
    overflow: hidden;
}

.faq-ai-summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    outline: none;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--primary-light);
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    transition: background 0.3s ease;
}

.faq-ai-summary::-webkit-details-marker {
    display: none;
}

.faq-ai-summary:hover {
    background: rgba(6, 182, 212, 0.1);
}

.faq-ai-icon {
    font-size: 0.9em;
    opacity: 0.8;
}

.faq-ai-details[open] .faq-ai-icon {
    transform: rotate(180deg);
}

.faq-ai-content {
    padding: 25px;
    border-top: 1px solid var(--border);
}

.faq-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.faq-list li {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.faq-list li:last-child {
    border-bottom: none;
}

.faq-list li strong {
    color: #fff;
    display: block;
    margin-bottom: 8px;
    font-size: 1.05rem;
}

.ai-context-pre {
    background: #000;
    color: #00FF41; /* Verde Matrix/Terminal clásico */
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    border: 1px solid #333;
    font-family: 'Roboto Mono', monospace;
    box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.1);
}

/* =========================================
   DISEÑO RESPONSIVE FINAL
   ========================================= */
@media (max-width: 850px) {
    .nav-container { flex-direction: column; gap: 15px; }
    .header-right { width: 100%; justify-content: center; }
    .search-form { width: 100%; }
    .recipe-content { padding: 25px; }
}

@media (max-width: 600px) {
    .nav-wrapper {
        grid-template-columns: 1fr;
    }
    .grid { grid-template-columns: 1fr; }
}