/* ============================================================
   PÁGINA CONOCIMIENTO — Estilos específicos (Tema Azul)
   ============================================================ */

/* Banner hero de la base de conocimiento */
.kb-hero {
    padding: 160px 0 80px;
    background: var(--gradient-hero);
    position: relative;
    text-align: center;
    overflow: hidden;
}

.kb-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), var(--accent-violet), transparent);
    opacity: 0.3;
}

.kb-hero .hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.25;
}

.kb-hero .hero-orb--cyan {
    width: 400px;
    height: 400px;
    background: rgba(14, 165, 233, 0.2);
    top: -20%;
    right: 10%;
}

.kb-hero .hero-orb--violet {
    width: 350px;
    height: 350px;
    background: rgba(99, 102, 241, 0.12);
    bottom: -30%;
    left: 5%;
}

.kb-hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

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

/* Barra de búsqueda */
.kb-search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.kb-search-input {
    width: 100%;
    padding: 18px 24px 18px 56px;
    background: white;
    border: 1px solid rgba(14, 165, 233, 0.15);
    border-radius: 100px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 1rem;
    outline: none;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-soft);
}

.kb-search-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 4px var(--accent-cyan-dim), var(--shadow-glow-cyan);
}

.kb-search-input::placeholder {
    color: var(--text-muted);
}

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

.kb-search-icon svg {
    width: 20px;
    height: 20px;
}

/* Filtros por categoría */
.kb-filters {
    padding: 40px 0;
    border-bottom: 1px solid rgba(14, 165, 233, 0.1);
}

.kb-filter-pills {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.kb-pill {
    padding: 8px 22px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(14, 165, 233, 0.1);
    border-radius: 100px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.kb-pill:hover {
    color: var(--accent-cyan);
    border-color: rgba(14, 165, 233, 0.2);
    background: white;
}

.kb-pill.active {
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
    background: var(--accent-cyan-dim);
    font-weight: 600;
}

/* Grilla de artículos */
.kb-articles {
    padding: 64px 0 120px;
}

.kb-articles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
}

.kb-articles-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.kb-article-count {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.kb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

/* Tarjeta de artículo */
.kb-card {
    position: relative;
    padding: 32px 28px;
    background: var(--bg-card);
    border: 1px solid rgba(14, 165, 233, 0.1);
    border-radius: var(--radius-lg);
    transition: all var(--transition-med);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.kb-card:hover {
    border-color: rgba(14, 165, 233, 0.2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card), var(--shadow-glow-cyan);
    background: white;
}

.kb-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.kb-card-category {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--accent-violet);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 4px 12px;
    background: var(--accent-violet-dim);
    border-radius: 100px;
}

.kb-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.kb-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--text-primary);
}

.kb-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
    flex-grow: 1;
}

.kb-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(14, 165, 233, 0.08);
}

.kb-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.kb-tag {
    padding: 3px 10px;
    font-size: 0.68rem;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    background: var(--accent-cyan-dim);
    border-radius: 100px;
}

.kb-card-read {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    white-space: nowrap;
}

/* Modal de detalle de artículo */
.kb-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    z-index: 5000;
    justify-content: center;
    align-items: flex-start;
    padding: 80px 24px 40px;
    overflow-y: auto;
}

.kb-modal-overlay.active {
    display: flex;
}

.kb-modal {
    background: white;
    border: 1px solid rgba(14, 165, 233, 0.1);
    border-radius: var(--radius-xl);
    max-width: 720px;
    width: 100%;
    padding: 48px;
    position: relative;
    animation: modal-in 0.4s ease;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

@keyframes modal-in {
    from { opacity: 0; transform: translateY(30px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.kb-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.kb-modal-close:hover {
    color: var(--text-primary);
    border-color: var(--accent-cyan);
    background: var(--accent-cyan-dim);
}

.kb-modal-category {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--accent-violet);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.kb-modal h2 {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.kb-modal-meta {
    display: flex;
    gap: 20px;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.kb-modal-content {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.9;
}

.kb-modal-content h3 {
    font-size: 1.15rem;
    color: var(--text-primary);
    margin: 28px 0 12px;
    font-weight: 700;
}

.kb-modal-content ul {
    padding-left: 20px;
    margin: 12px 0;
}

.kb-modal-content li {
    margin-bottom: 8px;
}

.kb-modal-content code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 2px 8px;
    background: var(--accent-cyan-dim);
    border-radius: 4px;
    color: var(--accent-cyan);
}

.kb-modal-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

/* Sin resultados */
.kb-no-results {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
    display: none;
}

.kb-no-results svg {
    width: 60px;
    height: 60px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.kb-no-results h3 {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.kb-no-results p {
    font-size: 0.9rem;
}

/* Diseño responsivo */
@media (max-width: 768px) {
    .kb-hero {
        padding: 140px 0 60px;
    }

    .kb-grid {
        grid-template-columns: 1fr;
    }

    .kb-modal {
        padding: 32px 24px;
    }

    .kb-modal h2 {
        font-size: 1.4rem;
    }

    .kb-articles-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}
