/**
 * Knowledgebase & Documentation Stylesheet (knowledgebase.css)
 * High-End SaaS UI (CaptainLinux Theme)
 */

/* ==========================================================================
   Hero Search Banner
   ========================================================================== */
.kb-hero-banner {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 18px;
    padding: 44px 32px;
    margin-bottom: 36px;
    color: #ffffff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 8px 10px -6px rgba(15, 23, 42, 0.1);
}

.kb-hero-banner::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.35) 0%, transparent 70%);
    pointer-events: none;
}

.kb-hero-banner.compact {
    padding: 24px 28px;
    margin-bottom: 30px;
}

.kb-hero-content {
    max-width: 720px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 2;
}

.kb-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #93c5fd;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 9999px;
    margin-bottom: 16px;
}

.kb-hero-title {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 10px;
    letter-spacing: -0.5px;
}

.kb-hero-subtitle {
    font-size: 15px;
    color: #94a3b8;
    margin: 0 0 28px;
    line-height: 1.5;
}

/* Search Input Box */
.kb-hero-search-form {
    width: 100%;
}

.kb-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 14px;
    padding: 6px 8px 6px 20px;
    box-shadow: 0 12px 30px -4px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.kb-search-input-wrapper:focus-within {
    box-shadow: 0 12px 35px -4px rgba(37, 99, 235, 0.35), 0 0 0 3px rgba(59, 130, 246, 0.4);
}

.kb-search-icon {
    font-size: 18px;
    color: #64748b;
    margin-right: 12px;
}

.kb-search-input {
    flex: 1;
    height: 44px;
    border: none !important;
    background: transparent !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #0f172a !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.kb-search-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.kb-search-submit-btn {
    height: 44px;
    padding: 0 22px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 14.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transition: all 0.2s ease;
}

.kb-search-submit-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

/* ==========================================================================
   Section Headers
   ========================================================================== */
.kb-section-header {
    margin-bottom: 22px;
}

.kb-section-header.popular-section-header {
    margin-top: 48px;
}

.kb-section-title-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kb-section-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.kb-section-icon.popular-icon {
    background: #fff7ed;
    color: #ea580c;
}

.kb-section-icon.doc-icon {
    background: #f0fdf4;
    color: #16a34a;
}

.kb-section-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 3px;
    letter-spacing: -0.3px;
}

.kb-section-desc {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
}

/* ==========================================================================
   Category Cards Grid
   ========================================================================== */
.kb-categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
    margin-bottom: 30px;
}

.kb-category-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px 24px;
    position: relative;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.kb-category-card:hover {
    border-color: #2563eb;
    transform: translateY(-3px);
    box-shadow: 0 12px 25px -4px rgba(37, 99, 235, 0.12), 0 4px 6px -2px rgba(37, 99, 235, 0.05);
}

.kb-category-card-inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.kb-cat-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f1f5f9;
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.kb-category-card:hover .kb-cat-icon {
    background: #eff6ff;
    color: #2563eb;
}

.kb-cat-content {
    flex: 1;
    min-width: 0;
}

.kb-cat-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.kb-cat-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.35;
    transition: color 0.15s ease;
}

.kb-category-card:hover .kb-cat-name {
    color: #2563eb;
}

.kb-count-badge {
    font-size: 11.5px;
    font-weight: 700;
    background: #f1f5f9;
    color: #475569;
    padding: 3px 9px;
    border-radius: 9999px;
    white-space: nowrap;
}

.kb-category-card:hover .kb-count-badge {
    background: #dbeafe;
    color: #1d4ed8;
}

.kb-cat-description {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.kb-card-arrow {
    position: absolute;
    right: 18px;
    bottom: 18px;
    color: #cbd5e1;
    font-size: 12px;
    transition: all 0.2s ease;
}

.kb-category-card:hover .kb-card-arrow {
    color: #2563eb;
    transform: translateX(3px);
}

.kb-admin-actions {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid #f1f5f9;
}

.kb-admin-edit-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 2px 8px;
    border-radius: 6px;
    text-decoration: none !important;
}

.kb-admin-edit-pill:hover {
    color: #2563eb;
    border-color: #bfdbfe;
}

/* ==========================================================================
   Articles Grid (Popular & Category Views)
   ========================================================================== */
.kb-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 18px;
}

.kb-article-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 22px 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.kb-article-card:hover {
    border-color: #2563eb;
    transform: translateY(-3px);
    box-shadow: 0 12px 25px -4px rgba(37, 99, 235, 0.12), 0 4px 6px -2px rgba(37, 99, 235, 0.05);
}

.kb-article-link {
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.kb-article-card-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.kb-file-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.kb-article-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.4;
    transition: color 0.15s ease;
}

.kb-article-card:hover .kb-article-card-title {
    color: #2563eb;
}

.kb-article-card-excerpt {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 16px;
    line-height: 1.55;
    flex: 1;
}

.kb-article-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.kb-read-more {
    font-size: 13px;
    font-weight: 700;
    color: #2563eb;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s ease;
}

.kb-article-card:hover .kb-read-more {
    gap: 9px;
}

.kb-admin-article-edit {
    margin-top: 8px;
}

/* ==========================================================================
   Single Article View (knowledgebasearticle.tpl)
   ========================================================================== */
.kb-article-view-container {
    max-width: 900px;
    margin: 0 auto;
}

.kb-article-header-box {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    padding: 30px 36px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.kb-article-meta-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}

.kb-back-link {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: color 0.15s ease;
}

.kb-back-link:hover {
    color: #2563eb;
}

.kb-actions-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.kb-print-btn, .kb-admin-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    transition: all 0.15s ease;
}

.kb-print-btn:hover, .kb-admin-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #cbd5e1;
}

.kb-single-article-title {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 16px;
    line-height: 1.35;
    letter-spacing: -0.5px;
}

.kb-article-meta-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #64748b;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.kb-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.kb-tags-list span {
    background: #eff6ff;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 12px;
}

/* Article Content Body */
.kb-article-content-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 18px;
    padding: 36px 40px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
}

.kb-article-text-body {
    font-size: 15.5px;
    line-height: 1.75;
    color: #334155;
}

.kb-article-text-body h1, .kb-article-text-body h2, .kb-article-text-body h3, .kb-article-text-body h4 {
    color: #0f172a;
    font-weight: 800;
    margin-top: 28px;
    margin-bottom: 14px;
}

.kb-article-text-body p {
    margin-bottom: 18px;
}

.kb-article-text-body pre, .kb-article-text-body code {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 14px;
}

.kb-article-text-body pre {
    padding: 16px 20px;
    overflow-x: auto;
    margin: 20px 0;
}

.kb-article-text-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Rating / Feedback Section */
.kb-article-rating-section {
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1.5px solid #f1f5f9;
}

.kb-rating-form {
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 22px 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.kb-rating-prompt {
    display: flex;
    align-items: center;
    gap: 14px;
}

.kb-rating-icon {
    font-size: 26px;
    color: #2563eb;
}

.kb-rating-text-wrap h4 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 3px;
}

.kb-rating-text-wrap p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.kb-rating-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kb-btn-vote {
    height: 40px;
    padding: 0 18px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.vote-yes {
    background: #ecfdf5;
    border: 1.5px solid #a7f3d0;
    color: #059669;
}

.vote-yes:hover {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
}

.vote-no {
    background: #fef2f2;
    border: 1.5px solid #fecaca;
    color: #dc2626;
}

.vote-no:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
}

.kb-voted-badge {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13.5px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.kb-vote-feedback-alert {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

/* Related Section */
.kb-related-section {
    margin-top: 40px;
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.kb-empty-state {
    background: #ffffff;
    border: 1.5px dashed #cbd5e1;
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    grid-column: 1 / -1;
}

.kb-empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
}

.kb-empty-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px;
}

.kb-empty-desc {
    font-size: 14px;
    color: #64748b;
    max-width: 420px;
    margin: 0 auto;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .kb-hero-banner {
        padding: 32px 20px;
    }

    .kb-hero-title {
        font-size: 22px;
    }

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

    .kb-article-header-box, .kb-article-content-card {
        padding: 24px 20px;
    }

    .kb-rating-form {
        flex-direction: column;
        align-items: stretch;
    }

    .kb-rating-actions {
        justify-content: center;
    }
}
