/* Knowledge Base Styles */

body.kb-page {
    --kb-page-bg: var(--background-primary);
    --kb-section-bg: var(--background-primary);
    --kb-section-alt-bg: var(--background-secondary);
    --kb-card-bg: var(--surface);
    --kb-card-border: rgba(226, 232, 240, 0.92);
    --kb-card-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
    --kb-card-hover-shadow: 0 24px 54px rgba(15, 23, 42, 0.14);
    --kb-text: var(--text-primary);
    --kb-muted: var(--text-secondary);
    --kb-soft: rgba(100, 116, 139, 0.12);
    --kb-hero-bg: linear-gradient(135deg, #F8FAFC 0%, #D4AF37 44%, #B8860B 100%);
    --kb-hero-text: #172033;
    --kb-hero-muted: rgba(23, 32, 51, 0.76);
    --kb-hero-pattern: rgba(15, 23, 42, 0.045);
    --kb-accent: #B8860B;
    --kb-accent-strong: #D4AF37;
    --kb-accent-soft: rgba(212, 175, 55, 0.14);
    --kb-control-bg: #FFFFFF;
    --kb-control-border: #E2E8F0;
    --kb-code-bg: #F8FAFC;
    --kb-code-text: #1E293B;
    background: var(--kb-page-bg);
    color: var(--kb-text);
}

html[data-theme="dark"] body.kb-page {
    --kb-page-bg: #08111F;
    --kb-section-bg: #08111F;
    --kb-section-alt-bg: #0D1728;
    --kb-card-bg: rgba(17, 28, 50, 0.92);
    --kb-card-border: rgba(148, 163, 184, 0.18);
    --kb-card-shadow: 0 18px 46px rgba(2, 6, 23, 0.36);
    --kb-card-hover-shadow: 0 26px 64px rgba(2, 6, 23, 0.5);
    --kb-text: #F5F7FA;
    --kb-muted: #B8C4D4;
    --kb-soft: rgba(148, 163, 184, 0.12);
    --kb-hero-bg: linear-gradient(135deg, #07101F 0%, #111C32 48%, #59471A 100%);
    --kb-hero-text: #F8FAFC;
    --kb-hero-muted: rgba(226, 232, 240, 0.82);
    --kb-hero-pattern: rgba(226, 232, 240, 0.055);
    --kb-accent: #F3C969;
    --kb-accent-strong: #F7D983;
    --kb-accent-soft: rgba(247, 217, 131, 0.14);
    --kb-control-bg: rgba(15, 23, 42, 0.92);
    --kb-control-border: rgba(148, 163, 184, 0.22);
    --kb-code-bg: rgba(15, 23, 42, 0.88);
    --kb-code-text: #E5EDF7;
}

/* Animation for rotating background effect */
@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* KB Hero Section */
.kb-hero {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Add visual interest with animated background */
.kb-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

/* Add subtle texture */
.kb-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.kb-hero .hero-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a1a1a;
    position: relative;
    z-index: 1;
}

.kb-hero .hero-subtitle {
    font-size: 1.25rem;
    color: rgba(0, 0, 0, 0.8);
    margin-bottom: 3rem;
    position: relative;
    z-index: 1;
}

/* Search Bar */
.kb-search {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.kb-search-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.5rem;
    font-size: 1.125rem;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.kb-search-input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.2);
    background: white;
}

.kb-search-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* Categories Section */
.kb-categories {
    padding: 4rem 0;
    background: white;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.category-card {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: #D4AF37;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.15);
}

.category-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    border-radius: 20px;
    color: white;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.category-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.category-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-count {
    font-size: 0.875rem;
    color: #B8860B;
    font-weight: 600;
}

/* Articles Section */
.kb-articles {
    padding: 4rem 0;
    background: var(--bg-light);
}

.kb-articles h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.articles-list {
    display: grid;
    gap: 1.5rem;
}

.article-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.article-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.article-category {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #B8860B;
    background: rgba(212, 175, 55, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 0.75rem;
}

.article-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.article-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-card h3 a:hover {
    color: #B8860B;
}

.article-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Popular Articles Section */
.kb-popular {
    padding: 4rem 0;
    background: white;
}

.kb-popular h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.popular-grid {
    display: grid;
    gap: 1rem;
}

.popular-article {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.popular-article:hover {
    background: white;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.popular-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: white;
    font-weight: 700;
    border-radius: 10px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
}

.popular-content h4 {
    margin-bottom: 0.25rem;
}

.popular-content h4 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.popular-content h4 a:hover {
    color: #B8860B;
}

.article-category-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* KB CTA Section */
.kb-cta {
    padding: 6rem 0;
    background: var(--gradient-primary);
    text-align: center;
    color: white;
}

.kb-cta h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: white;
}

.kb-cta p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.kb-cta .cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.kb-cta .cta-primary {
    background: white;
    color: var(--primary-color);
}

.kb-cta .cta-primary:hover {
    background: #f8f9fa;
}

.kb-cta .cta-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.kb-cta .cta-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Article Page Styles */
.article-hero {
    padding: 8rem 0 4rem;
    background: linear-gradient(135deg, #2563EB 0%, #1e40af 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

/* Alternative gold/professional theme - add class="article-hero gold-theme" to use */
.article-hero.gold-theme {
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: #1a1a1a;
}

.article-hero.gold-theme .article-header h1 {
    color: #1a1a1a;
}

.article-hero.gold-theme .breadcrumb a {
    color: rgba(0, 0, 0, 0.7);
}

.article-hero.gold-theme .breadcrumb a:hover {
    color: #1a1a1a;
}

.article-hero.gold-theme .breadcrumb span {
    color: rgba(0, 0, 0, 0.5);
}

.article-hero.gold-theme .article-info {
    color: rgba(0, 0, 0, 0.8);
}

.article-hero.gold-theme .article-category {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a1a;
}

.article-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

.article-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.05));
    pointer-events: none;
}

/* Add a subtle grid pattern overlay for more visual interest */
.article-hero .hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

.article-hero .breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
}

.article-hero .breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-hero .breadcrumb a:hover {
    color: white;
}

.article-hero .breadcrumb span {
    color: rgba(255, 255, 255, 0.6);
}

.article-header {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.article-header h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1.5rem;
    color: white;
    font-weight: 700;
}

.article-info {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    color: rgba(255, 255, 255, 0.9);
}

.article-info .article-category {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.article-content {
    padding: 4rem 0;
    background: white;
}

.article-body {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.article-body h2 {
    font-size: 2rem;
    margin: 3rem 0 1.5rem;
    color: var(--text-primary);
}

.article-body h3 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
}

.article-body p {
    margin-bottom: 1.5rem;
}

.article-body ul,
.article-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.article-body li {
    margin-bottom: 0.5rem;
}

.article-body code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.9em;
}

.article-body pre {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.article-body pre code {
    background: none;
    padding: 0;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
}

.article-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Related Articles */
.related-articles {
    padding: 4rem 0;
    background: var(--bg-light);
}

.related-articles h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-primary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Category Page Styles */
.category-hero {
    padding: 6rem 0 3rem;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: #1a1a1a;
    position: relative;
    overflow: hidden;
}

.category-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 30s linear infinite;
}

.category-hero .hero-pattern {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.category-header {
    position: relative;
    z-index: 1;
}

.category-hero .breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.category-hero .breadcrumb a {
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.category-hero .breadcrumb a:hover {
    color: #1a1a1a;
}

.category-hero .breadcrumb span {
    color: rgba(0, 0, 0, 0.5);
}

.category-title-section {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.category-icon-large {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #B8860B;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.category-title-section h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.category-description {
    font-size: 1.25rem;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.8);
    max-width: 800px;
}

/* Quick Links Section */
.category-quicklinks {
    padding: 3rem 0;
    background: white;
    border-bottom: 1px solid var(--border-color);
}

.quicklinks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.quicklink-card {
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.quicklink-card:hover {
    transform: translateY(-2px);
    border-color: #D4AF37;
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.1);
}

.quicklink-card h3 {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.quicklink-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Category Articles Section */
.category-articles {
    padding: 4rem 0;
    background: var(--bg-light);
}

.articles-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.articles-header h2 {
    font-size: 2rem;
    color: var(--text-primary);
}

.articles-filter {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.filter-btn:hover {
    border-color: #D4AF37;
}

.filter-btn.active {
    background: #D4AF37;
    color: white;
    border-color: #D4AF37;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.article-tile {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.article-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.article-tile-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.article-icon {
    width: 48px;
    height: 48px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #B8860B;
}

.article-tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #B8860B;
    background: rgba(212, 175, 55, 0.1);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.article-tile h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    flex-grow: 1;
}

.article-tile h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-tile h3 a:hover {
    color: #B8860B;
}

.article-tile p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.difficulty-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.difficulty-badge.easy {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.difficulty-badge.medium {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.difficulty-badge.hard {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.time-estimate {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.coming-soon {
    opacity: 0.7;
}

.coming-soon-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

/* Related Resources */
.related-resources {
    padding: 4rem 0;
    background: white;
}

.related-resources h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--text-primary);
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
}

.resource-card {
    text-align: center;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 16px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.resource-card:hover {
    transform: translateY(-4px);
    border-color: #D4AF37;
    box-shadow: 0 8px 24px rgba(212, 175, 55, 0.1);
}

.resource-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.resource-card h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.resource-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* KB card and theme treatment */
body.kb-page .kb-hero,
body.kb-page .category-hero,
body.kb-page .article-hero {
    background: var(--kb-hero-bg);
    color: var(--kb-hero-text);
}

body.kb-page .kb-hero::after,
body.kb-page .category-hero .hero-pattern,
body.kb-page .article-hero .hero-pattern {
    background-image:
        linear-gradient(var(--kb-hero-pattern) 1px, transparent 1px),
        linear-gradient(90deg, var(--kb-hero-pattern) 1px, transparent 1px);
}

body.kb-page .kb-hero .hero-title,
body.kb-page .category-title-section h1,
body.kb-page .category-hero .breadcrumb a:hover,
body.kb-page .article-header h1,
body.kb-page .article-hero .breadcrumb a:hover {
    color: var(--kb-hero-text);
}

body.kb-page .kb-hero .hero-subtitle,
body.kb-page .category-description,
body.kb-page .category-hero .breadcrumb a,
body.kb-page .category-hero .breadcrumb span,
body.kb-page .article-hero .breadcrumb a,
body.kb-page .article-hero .breadcrumb span,
body.kb-page .article-info {
    color: var(--kb-hero-muted);
}

body.kb-page .kb-categories,
body.kb-page .kb-popular,
body.kb-page .article-content,
body.kb-page .category-quicklinks,
body.kb-page .related-resources,
body.kb-page .solution-search,
body.kb-page .emergency-help {
    background: var(--kb-section-bg);
}

body.kb-page .kb-articles,
body.kb-page .category-articles,
body.kb-page .related-articles,
body.kb-page .getting-started-steps,
body.kb-page .pro-tips,
body.kb-page .diagnostic-tools {
    background: var(--kb-section-alt-bg);
}

body.kb-page .kb-categories,
body.kb-page .kb-articles,
body.kb-page .kb-popular,
body.kb-page .article-content,
body.kb-page .related-articles,
body.kb-page .category-quicklinks,
body.kb-page .category-articles,
body.kb-page .related-resources,
body.kb-page .getting-started-steps,
body.kb-page .pro-tips,
body.kb-page .solution-search,
body.kb-page .emergency-help,
body.kb-page .diagnostic-tools {
    color: var(--kb-text);
}

body.kb-page .category-card,
body.kb-page .article-card,
body.kb-page .popular-article,
body.kb-page .quicklink-card,
body.kb-page .article-tile,
body.kb-page .resource-card,
body.kb-page .related-grid .article-card,
body.kb-page .tip-card,
body.kb-page .tool-card,
body.kb-page .step-item,
body.kb-page .search-box,
body.kb-page .emergency-banner {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background: var(--kb-card-bg);
    border: 1px solid var(--kb-card-border);
    box-shadow: var(--kb-card-shadow);
}

body.kb-page .category-card::before,
body.kb-page .article-card::before,
body.kb-page .popular-article::before,
body.kb-page .quicklink-card::before,
body.kb-page .article-tile::before,
body.kb-page .resource-card::before,
body.kb-page .tip-card::before,
body.kb-page .tool-card::before,
body.kb-page .step-item::before,
body.kb-page .search-box::before,
body.kb-page .emergency-banner::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--kb-accent), #38BDF8);
    opacity: 0.9;
    z-index: 0;
}

body.kb-page .category-card::after,
body.kb-page .article-card::after,
body.kb-page .popular-article::after,
body.kb-page .quicklink-card::after,
body.kb-page .article-tile::after,
body.kb-page .resource-card::after,
body.kb-page .tip-card::after,
body.kb-page .tool-card::after,
body.kb-page .step-item::after,
body.kb-page .search-box::after,
body.kb-page .emergency-banner::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 170px;
    height: 170px;
    border-radius: 999px;
    transform: translate(40%, -55%);
    background: radial-gradient(circle, var(--kb-accent-soft) 0%, rgba(212, 175, 55, 0) 72%);
    pointer-events: none;
    z-index: 0;
}

body.kb-page .category-card > *,
body.kb-page .article-card > *,
body.kb-page .popular-article > *,
body.kb-page .quicklink-card > *,
body.kb-page .article-tile > *,
body.kb-page .resource-card > *,
body.kb-page .tip-card > *,
body.kb-page .tool-card > *,
body.kb-page .step-item > *,
body.kb-page .search-box > *,
body.kb-page .emergency-banner > * {
    position: relative;
    z-index: 1;
}

body.kb-page .category-card:hover,
body.kb-page .article-card:hover,
body.kb-page .popular-article:hover,
body.kb-page .quicklink-card:hover,
body.kb-page .article-tile:hover,
body.kb-page .resource-card:hover,
body.kb-page .tip-card:hover,
body.kb-page .tool-card:hover {
    border-color: rgba(212, 175, 55, 0.55);
    box-shadow: var(--kb-card-hover-shadow);
}

body.kb-page .category-card h3,
body.kb-page .article-card h3 a,
body.kb-page .popular-content h4 a,
body.kb-page .article-body,
body.kb-page .article-body h2,
body.kb-page .article-body h3,
body.kb-page .quicklink-card h3,
body.kb-page .article-tile h3 a,
body.kb-page .resource-card h4,
body.kb-page .articles-header h2,
body.kb-page .related-resources h2,
body.kb-page .related-articles h2 {
    color: var(--kb-text);
}

body.kb-page .category-card p,
body.kb-page .article-card p,
body.kb-page .popular-article,
body.kb-page .article-meta,
body.kb-page .article-category-small,
body.kb-page .quicklink-card p,
body.kb-page .article-tile p,
body.kb-page .resource-card p,
body.kb-page .article-body li,
body.kb-page .time-estimate,
body.kb-page .coming-soon-badge {
    color: var(--kb-muted);
}

body.kb-page .article-category,
body.kb-page .article-tag,
body.kb-page .article-count {
    background: var(--kb-accent-soft);
    color: var(--kb-accent);
}

body.kb-page .category-icon,
body.kb-page .popular-number,
body.kb-page .article-icon,
body.kb-page .resource-icon,
body.kb-page .step-number,
body.kb-page .tip-icon,
body.kb-page .tool-icon,
body.kb-page .emergency-icon {
    background: linear-gradient(135deg, var(--kb-accent-strong), var(--kb-accent));
    color: #08111F;
    box-shadow: 0 10px 26px rgba(184, 134, 11, 0.22);
}

body.kb-page .kb-search-input,
body.kb-page .solution-search-input,
body.kb-page .filter-btn {
    background: var(--kb-control-bg);
    border-color: var(--kb-control-border);
    color: var(--kb-text);
}

body.kb-page .kb-search-input::placeholder,
body.kb-page .solution-search-input::placeholder {
    color: var(--kb-muted);
}

body.kb-page .filter-btn {
    border: 1px solid var(--kb-control-border);
}

body.kb-page .filter-btn.active,
body.kb-page .search-button,
body.kb-page .emergency-button,
body.kb-page .tool-link {
    background: linear-gradient(135deg, var(--kb-accent-strong), var(--kb-accent));
    color: #08111F;
    border-color: transparent;
}

body.kb-page .emergency-button.secondary {
    background: transparent;
    color: var(--kb-accent);
    border: 1px solid rgba(212, 175, 55, 0.5);
}

body.kb-page .kb-cta {
    background: var(--gradient-primary);
    color: #FFFFFF;
}

html[data-theme="dark"] body.kb-page .kb-cta {
    background: linear-gradient(135deg, #07101F 0%, #10213E 52%, #1E3A8A 100%);
}

body.kb-page .kb-cta h2,
body.kb-page .kb-cta p,
body.kb-page .kb-cta .cta-secondary {
    color: #FFFFFF;
}

body.kb-page .kb-cta .cta-primary {
    background: #FFFFFF;
    color: #1E3A8A;
}

body.kb-page .kb-cta .cta-secondary {
    border-color: rgba(255, 255, 255, 0.74);
}

body.kb-page .article-body code,
body.kb-page .article-body pre {
    background: var(--kb-code-bg);
    color: var(--kb-code-text);
}

body.kb-page .article-body blockquote {
    color: var(--kb-muted);
    border-left-color: var(--kb-accent);
}

/* Category-page supporting sections */
.getting-started-steps,
.pro-tips,
.solution-search,
.emergency-help,
.diagnostic-tools {
    padding: 4rem 0;
}

.steps-timeline,
.tips-grid,
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.step-item,
.tip-card,
.tool-card,
.search-box,
.emergency-banner {
    border-radius: 16px;
    padding: 1.6rem;
}

.step-number,
.tip-icon,
.tool-icon,
.emergency-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-weight: 700;
}

.step-content h3,
.tip-card h3,
.tool-card h3,
.search-box h2,
.emergency-content h2 {
    margin-bottom: 0.6rem;
    color: var(--kb-text);
}

.step-content p,
.tip-card p,
.tool-card p,
.emergency-content p,
.common-searches {
    color: var(--kb-muted);
}

.search-box {
    max-width: 880px;
    margin: 0 auto;
}

.search-input-wrapper {
    display: flex;
    gap: 0.8rem;
    margin: 1.2rem 0;
}

.solution-search-input {
    flex: 1;
    min-width: 0;
    padding: 0.9rem 1rem;
    border: 1px solid var(--kb-control-border);
    border-radius: 10px;
    font: inherit;
}

.search-button,
.emergency-button,
.tool-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.common-searches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    font-size: 0.9rem;
}

.common-searches a {
    color: var(--kb-accent);
    text-decoration: none;
}

.emergency-banner {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.emergency-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

/* Standalone KB auth pages */
html[data-theme="dark"] body.kb-auth-page,
html[data-theme="dark"] body.kb-register-page,
html[data-theme="dark"] body.kb-password-page {
    background: #08111F;
}

html[data-theme="dark"] body.kb-auth-page .auth-container,
html[data-theme="dark"] body.kb-password-page .password-container {
    background: radial-gradient(circle at 20% 15%, rgba(212, 175, 55, 0.14), transparent 32%),
        linear-gradient(135deg, #08111F 0%, #0D1728 100%);
}

html[data-theme="dark"] body.kb-register-page {
    background: radial-gradient(circle at 20% 15%, rgba(59, 130, 246, 0.14), transparent 32%),
        linear-gradient(135deg, #08111F 0%, #0D1728 100%);
}

html[data-theme="dark"] body.kb-auth-page .auth-card,
html[data-theme="dark"] body.kb-password-page .password-card,
html[data-theme="dark"] body.kb-register-page .register-container {
    background: rgba(17, 28, 50, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 24px 64px rgba(2, 6, 23, 0.5);
}

html[data-theme="dark"] body.kb-auth-page .auth-title,
html[data-theme="dark"] body.kb-password-page .password-title,
html[data-theme="dark"] body.kb-register-page .register-header h1,
html[data-theme="dark"] body.kb-auth-page .form-label,
html[data-theme="dark"] body.kb-password-page .form-label,
html[data-theme="dark"] body.kb-register-page .form-group label,
html[data-theme="dark"] body.kb-password-page .password-requirements h4 {
    color: #F8FAFC;
}

html[data-theme="dark"] body.kb-auth-page .auth-subtitle,
html[data-theme="dark"] body.kb-password-page .password-subtitle,
html[data-theme="dark"] body.kb-register-page .register-header p,
html[data-theme="dark"] body.kb-register-page .form-hint,
html[data-theme="dark"] body.kb-register-page .login-link,
html[data-theme="dark"] body.kb-auth-page .auth-switch,
html[data-theme="dark"] body.kb-auth-page .auth-divider,
html[data-theme="dark"] body.kb-auth-page .back-link,
html[data-theme="dark"] body.kb-password-page .requirement,
html[data-theme="dark"] body.kb-password-page .skip-link {
    color: #B8C4D4;
}

html[data-theme="dark"] body.kb-auth-page .form-input,
html[data-theme="dark"] body.kb-auth-page .form-textarea,
html[data-theme="dark"] body.kb-password-page .form-input,
html[data-theme="dark"] body.kb-register-page .form-input {
    background: rgba(8, 17, 31, 0.78);
    border-color: rgba(148, 163, 184, 0.22);
    color: #F8FAFC;
}

html[data-theme="dark"] body.kb-auth-page .form-input::placeholder,
html[data-theme="dark"] body.kb-auth-page .form-textarea::placeholder,
html[data-theme="dark"] body.kb-password-page .form-input::placeholder,
html[data-theme="dark"] body.kb-register-page .form-input::placeholder {
    color: rgba(184, 196, 212, 0.62);
}

html[data-theme="dark"] body.kb-password-page .password-requirements {
    background: rgba(8, 17, 31, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

html[data-theme="dark"] body.kb-auth-page .back-link:hover,
html[data-theme="dark"] body.kb-password-page .skip-link:hover {
    color: #F8FAFC;
}

html[data-theme="dark"] body.kb-auth-page .alert-success,
html[data-theme="dark"] body.kb-password-page .alert-success,
html[data-theme="dark"] body.kb-register-page .alert-success {
    background: rgba(16, 185, 129, 0.14);
    color: #A7F3D0;
    border-color: rgba(16, 185, 129, 0.34);
}

html[data-theme="dark"] body.kb-auth-page .alert-error,
html[data-theme="dark"] body.kb-password-page .alert-error,
html[data-theme="dark"] body.kb-register-page .alert-error {
    background: rgba(239, 68, 68, 0.14);
    color: #FECACA;
    border-color: rgba(239, 68, 68, 0.34);
}

html[data-theme="dark"] body.kb-auth-page .alert-info,
html[data-theme="dark"] body.kb-register-page .alert-info,
html[data-theme="dark"] body.kb-password-page .alert-warning {
    background: rgba(59, 130, 246, 0.14);
    color: #BFDBFE;
    border-color: rgba(59, 130, 246, 0.34);
}

/* Responsive */
@media (max-width: 768px) {
    .kb-hero {
        padding: 6rem 0 3rem;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .article-info {
        gap: 1rem;
        font-size: 0.875rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}
