/* ============================================
   Knowledge Base Hub — Premium Dark Theme
   ============================================ */

/* ============================================
   HERO
   ============================================ */
.kb-hub-hero {
    position: relative;
    background: #0C1220;
    padding: 80px 0 60px;
    overflow: hidden;
}

/* Animated gradient mesh background */
.kb-hub-hero__mesh {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 30%, rgba(37,99,235,0.1) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 80% 70%, rgba(139,92,246,0.07) 0%, transparent 70%),
        radial-gradient(ellipse 50% 40% at 50% 10%, rgba(6,182,212,0.05) 0%, transparent 70%);
    animation: kb-mesh-drift 12s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes kb-mesh-drift {
    0% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(20px, -10px) scale(1.02); }
    66% { transform: translate(-15px, 15px) scale(0.98); }
    100% { transform: translate(10px, -5px) scale(1.01); }
}

.kb-hub-hero__inner {
    position: relative;
    z-index: 1;
}

/* Badge */
.kb-hub-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(37,99,235,0.1);
    border: 1px solid rgba(37,99,235,0.2);
    border-radius: 100px;
    padding: 6px 16px;
    font-size: 13px;
    color: #60A5FA;
    margin-bottom: 24px;
}

.kb-hub-hero__badge-dot {
    width: 6px;
    height: 6px;
    background: #3B82F6;
    border-radius: 50%;
    animation: kb-dot-pulse 2s infinite;
}

@keyframes kb-dot-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
    50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(59,130,246,0); }
}

/* Title */
.kb-hub-hero__title {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 800;
    color: #F1F5F9;
    line-height: 1.15;
    margin: 0 0 16px;
    letter-spacing: -0.02em;
}

.kb-hub-hero__title span {
    background: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 50%, #06B6D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.kb-hub-hero__desc {
    font-size: 17px;
    color: #94A3B8;
    line-height: 1.6;
    max-width: 640px;
    margin: 0 0 36px;
}

/* Stats */
.kb-hub-hero__stats {
    display: flex;
    gap: 48px;
    margin-bottom: 40px;
}

.kb-hub-hero__stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.kb-hub-hero__stat-value {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #60A5FA, #A78BFA);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

.kb-hub-hero__stat-label {
    font-size: 13px;
    color: #64748B;
    font-weight: 500;
}

/* ============================================
   SEARCH
   ============================================ */
.kb-hub-search {
    position: relative;
    max-width: 540px;
    margin-bottom: 20px;
}

.kb-hub-search__icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748B;
    pointer-events: none;
    z-index: 2;
}

.kb-hub-search__input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    color: #F1F5F9;
    font-size: 15px;
    outline: none;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
}

.kb-hub-search__input::placeholder { color: #64748B; }

.kb-hub-search__input:focus {
    border-color: rgba(59,130,246,0.4);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1), 0 8px 32px rgba(0,0,0,0.2);
}

/* Search results dropdown */
.kb-hub-search__results {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #1E293B;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    max-height: 360px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}

.kb-hub-search__results.is-active {
    display: block;
}

.kb-hub-search__results-group {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.kb-hub-search__results-group:last-child {
    border-bottom: none;
}

.kb-hub-search__results-label {
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748B;
}

.kb-hub-search__result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #CBD5E1;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s;
    cursor: pointer;
}

.kb-hub-search__result:hover {
    background: rgba(37,99,235,0.08);
    color: #F1F5F9;
}

.kb-hub-search__result svg {
    flex-shrink: 0;
    color: #64748B;
}

.kb-hub-search__no-results {
    padding: 20px 16px;
    text-align: center;
    color: #64748B;
    font-size: 14px;
}

/* Quick Tags */
.kb-hub-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.kb-hub-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 100px;
    font-size: 13px;
    color: #94A3B8;
    text-decoration: none;
    transition: all 0.2s ease;
}

.kb-hub-tag:hover {
    background: rgba(59,130,246,0.1);
    border-color: rgba(59,130,246,0.25);
    color: #60A5FA;
}

/* ============================================
   SECTION HEADERS
   ============================================ */
.kb-hub-section-header {
    margin-bottom: 32px;
}

.kb-hub-section-title {
    font-size: clamp(22px, 2.5vw, 28px);
    font-weight: 700;
    color: #F1F5F9;
    margin: 0 0 6px;
}

.kb-hub-section-desc {
    font-size: 15px;
    color: #64748B;
    margin: 0;
}

/* ============================================
   FEATURED ARTICLES
   ============================================ */
.kb-hub-featured {
    background: #0F172A;
    padding: 64px 0;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.kb-hub-featured__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.kb-hub-featured__card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kb-hub-featured__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--feat-accent, #3B82F6), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kb-hub-featured__card:hover {
    background: rgba(37,99,235,0.05);
    border-color: rgba(37,99,235,0.2);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.kb-hub-featured__card:hover::before {
    opacity: 1;
}

/* Card accent colors by position */
.kb-hub-featured__card:nth-child(1) { --feat-accent: #3B82F6; }
.kb-hub-featured__card:nth-child(2) { --feat-accent: #8B5CF6; }
.kb-hub-featured__card:nth-child(3) { --feat-accent: #F59E0B; }
.kb-hub-featured__card:nth-child(4) { --feat-accent: #10B981; }
.kb-hub-featured__card:nth-child(5) { --feat-accent: #EF4444; }
.kb-hub-featured__card:nth-child(6) { --feat-accent: #06B6D4; }

.kb-hub-featured__card-cat {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--feat-accent, #3B82F6);
    margin-bottom: 10px;
}

.kb-hub-featured__card-title {
    font-size: 16px;
    font-weight: 600;
    color: #F1F5F9;
    line-height: 1.4;
    margin-bottom: 10px;
}

.kb-hub-featured__card-excerpt {
    font-size: 14px;
    color: #94A3B8;
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.kb-hub-featured__card:hover {
    border-color: color-mix(in srgb, var(--feat-accent, #3B82F6) 30%, transparent);
}

.kb-hub-featured__card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.06);
    font-size: 12px;
    color: #64748B;
}

.kb-hub-featured__card-meta svg {
    transition: transform 0.2s ease;
    color: #3B82F6;
}

.kb-hub-featured__card:hover .kb-hub-featured__card-meta svg {
    transform: translateX(4px);
}

/* ============================================
   SECTIONS GRID
   ============================================ */
.kb-hub-sections {
    background: #0C1220;
    padding: 64px 0;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.kb-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.kb-hub-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 24px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.kb-hub-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--card-accent), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kb-hub-card:hover {
    background: var(--card-bg);
    border-color: color-mix(in srgb, var(--card-accent) 25%, transparent);
    transform: translateY(-2px) translateX(2px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
}

.kb-hub-card:hover::before {
    opacity: 1;
}

.kb-hub-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--card-bg);
    border: 1px solid color-mix(in srgb, var(--card-accent) 15%, transparent);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.kb-hub-card:hover .kb-hub-card__icon {
    box-shadow: 0 0 20px color-mix(in srgb, var(--card-accent) 20%, transparent);
    border-color: color-mix(in srgb, var(--card-accent) 30%, transparent);
}

.kb-hub-card__body {
    flex: 1;
    min-width: 0;
}

.kb-hub-card__title {
    font-size: 16px;
    font-weight: 600;
    color: #F1F5F9;
    margin-bottom: 4px;
    line-height: 1.3;
}

.kb-hub-card__desc {
    font-size: 13px;
    color: #94A3B8;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-hub-card__footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.kb-hub-card__count {
    font-size: 12px;
    font-weight: 600;
    color: var(--card-accent);
    background: var(--card-bg);
    padding: 3px 10px;
    border-radius: 100px;
    border: 1px solid color-mix(in srgb, var(--card-accent) 20%, transparent);
}

.kb-hub-card__arrow {
    color: #64748B;
    margin-left: auto;
    transition: all 0.25s ease;
    opacity: 0;
    transform: translateX(-8px);
}

.kb-hub-card:hover .kb-hub-card__arrow {
    opacity: 1;
    transform: translateX(0);
    color: var(--card-accent);
}

/* ============================================
   RECENTLY UPDATED
   ============================================ */
.kb-hub-recent {
    background: #0F172A;
    padding: 64px 0;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.kb-hub-recent__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.kb-hub-recent__item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.kb-hub-recent__item:hover {
    background: rgba(37,99,235,0.04);
    border-color: rgba(37,99,235,0.15);
}

.kb-hub-recent__icon {
    min-width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(59,130,246,0.08);
    color: #3B82F6;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.kb-hub-recent__item:hover .kb-hub-recent__icon {
    background: rgba(59,130,246,0.15);
}

.kb-hub-recent__info {
    flex: 1;
    min-width: 0;
}

.kb-hub-recent__title {
    font-size: 14px;
    font-weight: 600;
    color: #F1F5F9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.kb-hub-recent__cat {
    font-size: 12px;
    color: #64748B;
    margin-top: 2px;
}

.kb-hub-recent__arrow {
    flex-shrink: 0;
    color: #475569;
    transition: all 0.2s ease;
    opacity: 0;
}

.kb-hub-recent__item:hover .kb-hub-recent__arrow {
    opacity: 1;
    color: #3B82F6;
}

/* ============================================
   CTA
   ============================================ */
.kb-hub-cta {
    background: linear-gradient(135deg, #0F2847 0%, #0C1D3A 50%, #1A1040 100%);
    border-top: 1px solid rgba(37,99,235,0.15);
    padding: 56px 0;
}

.kb-hub-cta__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.kb-hub-cta__text h3 {
    font-size: 24px;
    font-weight: 700;
    color: #F1F5F9;
    margin: 0 0 6px;
}

.kb-hub-cta__text p {
    font-size: 15px;
    color: #94A3B8;
    margin: 0;
}

.kb-hub-cta__actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.kb-hub-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    border: none;
    font-family: inherit;
}

.kb-hub-cta__btn--primary {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(37,99,235,0.3);
}

.kb-hub-cta__btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(37,99,235,0.5);
}

.kb-hub-cta__btn--secondary {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #CBD5E1;
}

.kb-hub-cta__btn--secondary:hover {
    background: rgba(255,255,255,0.1);
    color: #F1F5F9;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1023px) {
    .kb-hub-featured__grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .kb-hub-hero {
        padding: 60px 0 40px;
    }

    .kb-hub-hero__stats {
        gap: 32px;
    }

    .kb-hub-hero__stat-value {
        font-size: 24px;
    }

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

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

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

    .kb-hub-cta__inner {
        flex-direction: column;
        text-align: center;
    }

    .kb-hub-cta__actions {
        flex-direction: column;
        width: 100%;
    }

    .kb-hub-cta__btn {
        justify-content: center;
    }
}

@media (max-width: 479px) {
    .kb-hub-hero__stats {
        gap: 20px;
        flex-wrap: wrap;
    }

    .kb-hub-tags {
        gap: 6px;
    }

    .kb-hub-tag {
        font-size: 12px;
        padding: 5px 12px;
    }
}
