/**
 * HIPAA Controls & NIST Guidelines — KB Listing V3 Enhancement
 * Colorful, premium styling inspired by homepage certification tracks
 */

/* ============================================
   HERO HEADER — gradient background + accent
   ============================================ */

.kb-hero-hipaa .page-header-v3 {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0e4d61 100%);
    position: relative;
    overflow: hidden;
}

.kb-hero-nist .page-header-v3 {
    background: linear-gradient(135deg, #0f172a 0%, #3b1f5e 50%, #1e293b 100%);
    position: relative;
    overflow: hidden;
}

.kb-hero-hipaa .page-header-v3::before,
.kb-hero-nist .page-header-v3::before {
    background:
        radial-gradient(ellipse 60% 50% at 20% 30%, rgba(6, 182, 212, 0.25) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 70%, rgba(37, 99, 235, 0.2) 0%, transparent 60%);
}

.kb-hero-nist .page-header-v3::before {
    background:
        radial-gradient(ellipse 60% 50% at 20% 30%, rgba(124, 58, 237, 0.2) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 80% 70%, rgba(217, 119, 6, 0.15) 0%, transparent 60%);
}

.kb-hero-hipaa .page-title-v3,
.kb-hero-nist .page-title-v3 {
    color: #ffffff;
    font-size: var(--text-5xl);
    letter-spacing: var(--tracking-tighter);
}

.kb-hero-hipaa .page-description-v3,
.kb-hero-nist .page-description-v3 {
    color: rgba(255, 255, 255, 0.75);
}

.kb-hero-hipaa .page-breadcrumb a,
.kb-hero-nist .page-breadcrumb a {
    color: rgba(255, 255, 255, 0.6);
}

.kb-hero-hipaa .page-breadcrumb a:hover,
.kb-hero-nist .page-breadcrumb a:hover {
    color: #67e8f9;
}

.kb-hero-hipaa .page-breadcrumb span,
.kb-hero-nist .page-breadcrumb span {
    color: rgba(255, 255, 255, 0.8);
}

.kb-hero-hipaa .page-breadcrumb svg,
.kb-hero-nist .page-breadcrumb svg {
    color: rgba(255, 255, 255, 0.4);
}

/* Hero accent bar at bottom */
.kb-hero-hipaa .page-header-v3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #06b6d4, #16a34a);
}

.kb-hero-nist .page-header-v3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #7c3aed, #d97706, #f59e0b);
}

/* ============================================
   HERO STATS STRIP — floating count badge
   ============================================ */

.kb-stats-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-8);
    flex-wrap: wrap;
    margin-top: var(--space-8);
}

.kb-stat-pill {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
}

.kb-stat-pill strong {
    color: #67e8f9;
    font-weight: 700;
}

.kb-hero-nist .kb-stat-pill strong {
    color: #fbbf24;
}

/* ============================================
   COVERAGE OVERVIEW — colorful enhancements
   ============================================ */

.kb-overview-card {
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-3xl);
    padding: var(--space-10);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.kb-overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
}

.kb-overview-nist .kb-overview-card::before {
    background: linear-gradient(90deg, #7c3aed, #d97706);
}

.kb-overview-title {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--slate-900);
    margin-bottom: var(--space-2);
}

.kb-overview-subtitle {
    color: var(--slate-500);
    font-size: var(--text-sm);
}

.kb-total-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-5);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 700;
}

.kb-total-badge-hipaa {
    background: linear-gradient(135deg, #dbeafe, #cffafe);
    color: #1e40af;
}

.kb-total-badge-nist {
    background: linear-gradient(135deg, #f3e8ff, #fef3c7);
    color: #6d28d9;
}

/* Colorful category cards in overview */
.kb-category-card {
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    border: 1px solid var(--slate-100);
    background: var(--white);
    transition: all 0.3s var(--ease-smooth);
}

.kb-category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kb-category-name {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--slate-800);
}

.kb-category-count {
    font-size: var(--text-sm);
    font-weight: 700;
}

/* Color-coded progress bars */
.kb-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--slate-100);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--space-3);
}

.kb-progress-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.8s var(--ease-out-expo);
}

/* Auto-color categories */
.kb-category-card:nth-child(1) .kb-category-count { color: #2563eb; }
.kb-category-card:nth-child(1) .kb-progress-fill { background: linear-gradient(90deg, #2563eb, #3b82f6); }
.kb-category-card:nth-child(1):hover { border-color: #93c5fd; }

.kb-category-card:nth-child(2) .kb-category-count { color: #16a34a; }
.kb-category-card:nth-child(2) .kb-progress-fill { background: linear-gradient(90deg, #16a34a, #22c55e); }
.kb-category-card:nth-child(2):hover { border-color: #86efac; }

.kb-category-card:nth-child(3) .kb-category-count { color: #7c3aed; }
.kb-category-card:nth-child(3) .kb-progress-fill { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
.kb-category-card:nth-child(3):hover { border-color: #c4b5fd; }

.kb-category-card:nth-child(4) .kb-category-count { color: #d97706; }
.kb-category-card:nth-child(4) .kb-progress-fill { background: linear-gradient(90deg, #d97706, #f59e0b); }
.kb-category-card:nth-child(4):hover { border-color: #fcd34d; }

.kb-category-card:nth-child(5) .kb-category-count { color: #0891b2; }
.kb-category-card:nth-child(5) .kb-progress-fill { background: linear-gradient(90deg, #0891b2, #06b6d4); }
.kb-category-card:nth-child(5):hover { border-color: #67e8f9; }

.kb-category-card:nth-child(6) .kb-category-count { color: #e11d48; }
.kb-category-card:nth-child(6) .kb-progress-fill { background: linear-gradient(90deg, #e11d48, #f43f5e); }
.kb-category-card:nth-child(6):hover { border-color: #fda4af; }

.kb-category-card:nth-child(7) .kb-category-count { color: #6366f1; }
.kb-category-card:nth-child(7) .kb-progress-fill { background: linear-gradient(90deg, #6366f1, #818cf8); }
.kb-category-card:nth-child(7):hover { border-color: #a5b4fc; }

.kb-category-card:nth-child(8) .kb-category-count { color: #059669; }
.kb-category-card:nth-child(8) .kb-progress-fill { background: linear-gradient(90deg, #059669, #10b981); }
.kb-category-card:nth-child(8):hover { border-color: #6ee7b7; }

/* ============================================
   RISK LEVEL BADGES — color-coded
   ============================================ */

.kb-risk-card {
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius-xl);
    border: 1px solid var(--slate-100);
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s var(--ease-smooth);
}

.kb-risk-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kb-risk-label {
    font-size: var(--text-sm);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.kb-risk-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.kb-risk-critical .kb-risk-dot { background: #ef4444; box-shadow: 0 0 8px rgba(239, 68, 68, 0.4); }
.kb-risk-high .kb-risk-dot { background: #f97316; box-shadow: 0 0 8px rgba(249, 115, 22, 0.4); }
.kb-risk-medium .kb-risk-dot { background: #eab308; box-shadow: 0 0 8px rgba(234, 179, 8, 0.3); }
.kb-risk-low .kb-risk-dot { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.3); }

.kb-risk-critical .kb-risk-label { color: #dc2626; }
.kb-risk-high .kb-risk-label { color: #ea580c; }
.kb-risk-medium .kb-risk-label { color: #ca8a04; }
.kb-risk-low .kb-risk-label { color: #16a34a; }

.kb-risk-critical:hover { border-color: #fca5a5; }
.kb-risk-high:hover { border-color: #fed7aa; }
.kb-risk-medium:hover { border-color: #fde68a; }
.kb-risk-low:hover { border-color: #86efac; }

.kb-risk-count {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: 700;
}

.kb-risk-critical .kb-risk-count { background: #fef2f2; color: #dc2626; }
.kb-risk-high .kb-risk-count { background: #fff7ed; color: #ea580c; }
.kb-risk-medium .kb-risk-count { background: #fefce8; color: #ca8a04; }
.kb-risk-low .kb-risk-count { background: #f0fdf4; color: #16a34a; }

/* ============================================
   SEARCH BAR — enhanced with gradient focus
   ============================================ */

.kb-search-wrapper {
    max-width: 720px;
    margin: 0 auto var(--space-8);
}

.kb-search-bar {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-2xl);
    border: 2px solid var(--slate-200);
    box-shadow: var(--shadow-md);
    transition: all 0.3s var(--ease-smooth);
    overflow: hidden;
}

.kb-search-bar:focus-within {
    border-color: transparent;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15), var(--shadow-lg);
    background-image: linear-gradient(white, white), linear-gradient(90deg, #2563eb, #06b6d4);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.kb-hero-nist .kb-search-bar:focus-within {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15), var(--shadow-lg);
    background-image: linear-gradient(white, white), linear-gradient(90deg, #7c3aed, #d97706);
}

.kb-search-input {
    flex: 1;
    padding: var(--space-4) var(--space-6);
    background: transparent;
    border: none;
    outline: none;
    font-size: var(--text-lg);
    font-family: var(--font-body);
    color: var(--slate-900);
}

.kb-search-input::placeholder {
    color: var(--slate-400);
}

.kb-search-btn {
    padding: var(--space-4) var(--space-6);
    background: linear-gradient(135deg, #2563eb, #06b6d4);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.kb-hero-nist .kb-search-btn {
    background: linear-gradient(135deg, #7c3aed, #d97706);
}

.kb-search-btn:hover {
    filter: brightness(1.1);
}

/* ============================================
   CONTROL/GUIDELINE CARDS — gradient accents
   ============================================ */

.kb-card {
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    transition: all 0.4s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
}

.kb-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s var(--ease-out-expo);
}

.kb-hero-nist .kb-card::before {
    background: linear-gradient(90deg, #7c3aed, #d97706);
}

.kb-card:hover {
    border-color: transparent;
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.1), 0 0 0 1px rgba(6, 182, 212, 0.08);
    transform: translateY(-6px);
}

.kb-hero-nist .kb-card:hover {
    box-shadow: 0 16px 40px rgba(124, 58, 237, 0.1), 0 0 0 1px rgba(217, 119, 6, 0.08);
}

.kb-card:hover::before {
    transform: scaleX(1);
}

.kb-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-4);
    gap: var(--space-3);
}

.kb-card-id {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-lg);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.02em;
}

.kb-card-id-hipaa {
    background: linear-gradient(135deg, #dbeafe, #cffafe);
    color: #1e40af;
}

.kb-card-id-nist {
    background: linear-gradient(135deg, #f3e8ff, #fef3c7);
    color: #6d28d9;
}

/* Risk badge on cards */
.kb-card-risk {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.kb-card-risk-critical { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.kb-card-risk-high { background: #fff7ed; color: #ea580c; border: 1px solid #fed7aa; }
.kb-card-risk-medium { background: #fefce8; color: #ca8a04; border: 1px solid #fde68a; }
.kb-card-risk-low { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

.kb-card-title {
    font-size: var(--text-lg);
    font-weight: var(--font-bold);
    color: var(--slate-900);
    margin-bottom: var(--space-3);
    line-height: var(--leading-snug);
    transition: color 0.3s ease;
}

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

.kb-hero-nist .kb-card:hover .kb-card-title {
    color: #7c3aed;
}

.kb-card-desc {
    font-size: var(--text-sm);
    color: var(--slate-500);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-5);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kb-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: var(--space-4);
    border-top: 1px solid var(--slate-100);
}

.kb-card-category {
    font-size: var(--text-xs);
    color: var(--slate-500);
    font-weight: 500;
}

.kb-card-views {
    font-size: var(--text-xs);
    color: var(--slate-400);
    display: flex;
    align-items: center;
    gap: var(--space-1);
}

.kb-card-views svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   GUIDE CARDS — colorful icons
   ============================================ */

.kb-guide-card {
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    transition: all 0.3s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.kb-guide-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
}

.kb-guide-card:nth-child(1)::before { background: linear-gradient(90deg, #2563eb, #06b6d4); }
.kb-guide-card:nth-child(2)::before { background: linear-gradient(90deg, #16a34a, #22d3ee); }
.kb-guide-card:nth-child(3)::before { background: linear-gradient(90deg, #d97706, #f59e0b); }

.kb-guide-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.kb-guide-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-xl);
    margin-bottom: var(--space-5);
}

.kb-guide-card:nth-child(1) .kb-guide-icon { background: linear-gradient(135deg, #dbeafe, #cffafe); color: #2563eb; }
.kb-guide-card:nth-child(2) .kb-guide-icon { background: linear-gradient(135deg, #dcfce7, #cffafe); color: #16a34a; }
.kb-guide-card:nth-child(3) .kb-guide-icon { background: linear-gradient(135deg, #fef3c7, #ffe4e6); color: #d97706; }

.kb-guide-card:nth-child(1):hover { border-color: #93c5fd; }
.kb-guide-card:nth-child(2):hover { border-color: #86efac; }
.kb-guide-card:nth-child(3):hover { border-color: #fcd34d; }

.kb-guide-title {
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    color: var(--slate-900);
    margin-bottom: var(--space-3);
}

.kb-guide-desc {
    font-size: var(--text-base);
    color: var(--slate-600);
    line-height: var(--leading-relaxed);
}

/* ============================================
   CHECKLIST PILLARS — colored borders
   ============================================ */

.kb-pillar-card {
    padding: var(--space-5);
    border-radius: var(--radius-xl);
    border: 1px solid var(--slate-100);
    background: var(--white);
    transition: all 0.3s var(--ease-smooth);
    position: relative;
    overflow: hidden;
}

.kb-pillar-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 3px;
}

.kb-pillar-card:nth-child(1)::before { background: #2563eb; }
.kb-pillar-card:nth-child(2)::before { background: #16a34a; }
.kb-pillar-card:nth-child(3)::before { background: #d97706; }

.kb-pillar-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kb-pillar-card:nth-child(1):hover { border-color: #93c5fd; }
.kb-pillar-card:nth-child(2):hover { border-color: #86efac; }
.kb-pillar-card:nth-child(3):hover { border-color: #fcd34d; }

.kb-pillar-title {
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: var(--space-2);
}

.kb-pillar-card:nth-child(1) .kb-pillar-title { color: #1e40af; }
.kb-pillar-card:nth-child(2) .kb-pillar-title { color: #15803d; }
.kb-pillar-card:nth-child(3) .kb-pillar-title { color: #92400e; }

.kb-pillar-desc {
    font-size: var(--text-sm);
    color: var(--slate-600);
    line-height: var(--leading-relaxed);
}

/* ============================================
   CTA SECTION — enhanced with gradient orbs
   ============================================ */

.kb-cta-section {
    padding: var(--space-24) 0;
    background: var(--slate-900);
    position: relative;
    overflow: hidden;
}

.kb-cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(6, 182, 212, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(37, 99, 235, 0.2) 0%, transparent 50%);
}

.kb-hero-nist .kb-cta-section::before {
    background:
        radial-gradient(ellipse 60% 50% at 20% 80%, rgba(124, 58, 237, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse 50% 40% at 80% 20%, rgba(217, 119, 6, 0.15) 0%, transparent 50%);
}

.kb-cta-inner {
    position: relative;
    text-align: center;
    max-width: 680px;
    margin: 0 auto;
}

.kb-cta-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-bold);
    color: #ffffff;
    margin-bottom: var(--space-4);
}

.kb-cta-desc {
    font-size: var(--text-lg);
    color: var(--slate-400);
    margin-bottom: var(--space-8);
    line-height: var(--leading-relaxed);
}

.kb-cta-actions {
    display: flex;
    gap: var(--space-4);
    justify-content: center;
    flex-wrap: wrap;
}

.kb-cta-actions .btn-outline {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

.kb-cta-actions .btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

/* ============================================
   FILTER CARD — enhanced styling
   ============================================ */

.kb-filter-card {
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-2xl);
    padding: var(--space-8);
    box-shadow: var(--shadow-sm);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .kb-hero-hipaa .page-title-v3,
    .kb-hero-nist .page-title-v3 {
        font-size: var(--text-3xl);
    }

    .kb-stats-strip {
        gap: var(--space-4);
    }

    .kb-cta-actions {
        flex-direction: column;
        align-items: center;
    }
}
