/**
 * EPCO - Base de Conocimiento
 * Estilos para la página de base de conocimiento
 */

/* === Variables y tipografía global === */
* { font-family: 'Lato', sans-serif; }
h1, h2, h3, h4, h5, h6, .fw-bold, .fw-semibold, .btn, .badge { font-family: 'Montserrat', sans-serif; }
:root { --primary: #0ea5e9; --primary-light: #0284c7; }
body { background: #f1f5f9; min-height: 100vh; }

/* === Navbar === */
.navbar-epco { background: linear-gradient(135deg, var(--primary), var(--primary-light)); }

/* === Page header === */
.page-header {
    background: linear-gradient(135deg, rgba(3,105,161,0.75) 0%, rgba(7,89,133,0.8) 50%, rgba(3,105,161,0.75) 100%);
    color: white;
    padding: 50px 0;
    position: relative;
    overflow: hidden;
}

/* === Cards === */
.card { border: none; border-radius: 16px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.article-card { transition: all 0.3s ease; }
.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* === Contenido de artículo === */
.article-content { line-height: 1.8; }
.article-content h4 { margin-top: 1.5rem; color: var(--primary); }
.article-content pre {
    background: #f8fafc;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
}
.article-content ol,
.article-content ul { padding-left: 1.5rem; }

/* === Botones de feedback === */
.helpful-btn {
    padding: 10px 20px;
    border-radius: 50px;
    border: 2px solid;
    background: transparent;
    font-weight: 500;
    transition: all 0.3s;
}
.helpful-btn:hover { transform: scale(1.05); }

/* === Buscador === */
.search-box {
    background: white;
    border-radius: 50px;
    padding: 5px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}
.search-box .form-control {
    border: none;
    padding: 15px 25px;
    border-radius: 50px;
}
.search-box .form-control:focus { box-shadow: none; }
.search-box .btn { border-radius: 50px; padding: 12px 30px; }

/* === Barra de stats === */
.kb-topbar-info {
    background: white;
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.kb-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #475569;
}
.kb-action-link {
    color: #0369a1;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.2s;
}
.kb-action-link:hover {
    background: #e0f2fe;
    color: #075985;
}

/* === Category pills === */
.kb-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.kb-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 50px;
    background: white;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.kb-pill:hover { background: #f0f9ff; color: #0369a1; border-color: #bae6fd; }
.kb-pill.active { background: #0369a1; color: white; border-color: #0369a1; }
.kb-pill.active .kb-pill-count { background: rgba(255,255,255,0.2); color: white; }
.kb-pill-count {
    background: #f1f5f9;
    color: #64748b;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
}

/* === Título de sección === */
.kb-section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f5f9;
}

/* === Featured cards === */
.kb-featured-card { border-left: 3px solid #f59e0b !important; }
.kb-featured-card:hover { border-left-color: #d97706 !important; }

/* === Article icon === */
.kb-art-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

/* === Accordion === */
.kb-accordion .accordion-item {
    border: none;
    border-radius: 14px !important;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 12px;
    overflow: hidden;
}
.kb-accordion-btn {
    padding: 16px 20px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    background: white !important;
    color: #1e293b !important;
    box-shadow: none !important;
    gap: 12px;
}
.kb-accordion-btn:not(.collapsed) {
    background: #f8fafc !important;
}
.kb-accordion-btn::after {
    background-size: 1rem;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}
.kb-acc-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}
.kb-acc-title { flex-grow: 1; }
.kb-acc-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.kb-accordion-btn:not(.collapsed) .kb-acc-count {
    background: #e0f2fe;
    color: #0369a1;
}

/* === Article items inside accordion === */
.kb-article-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    background: #f8fafc;
    transition: all 0.25s ease;
    height: 100%;
}
.kb-article-item:hover {
    background: #e0f2fe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(3,105,161,0.1);
}
.kb-article-item-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}
.kb-article-item-body h6 {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
    line-height: 1.3;
}
.kb-article-item-body p {
    font-size: 0.78rem;
    color: #64748b;
    margin-bottom: 6px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.kb-article-item-meta {
    display: flex;
    gap: 10px;
    font-size: 0.72rem;
    color: #94a3b8;
}
.kb-article-item-meta i { margin-right: 2px; }

/* === Contact bar === */
.kb-contact-bar {
    background: white;
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    color: #475569;
}
.kb-contact-bar i { color: #0369a1; }

/* === Topbar público (usuarios no logueados) === */
.epco-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}
.topbar-back-btn {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}
.topbar-back-btn:hover {
    background: rgba(255,255,255,0.25);
    color: white;
    transform: translateX(-3px);
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}
.topbar-badge {
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}
body { padding-top: 60px !important; }
.page-header { margin-top: 0 !important; }

/* === Responsive === */
@media (max-width: 768px) {
    .kb-category-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
    .kb-pill { white-space: nowrap; flex-shrink: 0; }
    .kb-topbar-info .row > div { text-align: center !important; }
    .kb-topbar-info .d-flex { justify-content: center; }
    .kb-accordion-btn { padding: 12px 14px; font-size: 0.92rem; }
    .kb-acc-icon { width: 32px; height: 32px; font-size: 0.85rem; }
    .kb-article-item { padding: 10px; }
    .kb-contact-bar .d-flex { flex-direction: column; text-align: center; }
}
@media (max-width: 576px) {
    .kb-stat-pill { font-size: 0.78rem; padding: 4px 10px; }
    .kb-featured-section .col-lg-3 { flex: 0 0 85%; max-width: 85%; }
    .kb-featured-section .row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
}
