/* Knowledge Base Viewer Styles */
.kb-article-content,
.kb-home-content {
    /* Remove default padding/margin since we're using the knowledge-base.css styles */
}

/* Search suggestions dropdown (keep this as it's specific to kb-viewer) */

/* Keep search suggestions specific to kb-viewer */

/* Search Suggestions */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 100;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    text-decoration: none;
    color: #1F2937;
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: #F3F4F6;
}

.suggestion-item:first-child {
    border-radius: 12px 12px 0 0;
}

.suggestion-item:last-child {
    border-radius: 0 0 12px 12px;
}

.suggestion-type {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.suggestion-article .suggestion-type {
    background: #DBEAFE;
    color: #1E40AF;
}

.suggestion-category .suggestion-type {
    background: #E0E7FF;
    color: #4338CA;
}

.suggestion-tag .suggestion-type {
    background: #FEF3C7;
    color: #B45309;
}

/* Categories Grid */
.kb-categories {
    margin-bottom: 60px;
}

.kb-categories h2 {
    font-size: 32px;
    margin-bottom: 32px;
    color: #1F2937;
}

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

.category-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #1E3A8A, #7C3AED);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

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

.category-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 16px;
}

.category-card h3 {
    font-size: 24px;
    margin-bottom: 8px;
    color: #1F2937;
}

.category-card p {
    color: #6B7280;
    margin-bottom: 16px;
}

.article-count {
    font-size: 14px;
    color: #9CA3AF;
    font-weight: 500;
}

/* Articles List */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-item {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.article-item:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.article-item h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #1F2937;
}

.article-item p {
    color: #6B7280;
    margin-bottom: 12px;
    line-height: 1.6;
}

.article-meta {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: #9CA3AF;
}

.article-meta .category {
    color: #7C3AED;
    font-weight: 500;
}

/* Tags Cloud */
.kb-popular-tags {
    margin-top: 60px;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    padding: 40px;
    background: white;
    border-radius: 12px;
}

.tag-item {
    padding: 8px 16px;
    background: #F3F4F6;
    border-radius: 20px;
    text-decoration: none;
    color: #4B5563;
    transition: all 0.2s ease;
}

.tag-item:hover {
    background: #7C3AED;
    color: white;
    transform: scale(1.1);
}

/* Article View */
.kb-article {
    background: white;
    border-radius: 16px;
    padding: 48px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.kb-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.kb-breadcrumb a {
    color: #6B7280;
    text-decoration: none;
}

.kb-breadcrumb a:hover {
    color: #7C3AED;
}

.kb-breadcrumb .separator {
    color: #D1D5DB;
}

.kb-breadcrumb .current {
    color: #1F2937;
    font-weight: 500;
}

.kb-article-title {
    font-size: 48px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 24px;
    line-height: 1.2;
}

.kb-article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #6B7280;
    font-size: 14px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E5E7EB;
}

.kb-article-tags {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.kb-tag {
    padding: 6px 12px;
    background: #EEF2FF;
    color: #4338CA;
    border-radius: 16px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.kb-tag:hover {
    background: #4338CA;
    color: white;
}

/* Article Body */
.kb-article-body {
    font-size: 18px;
    line-height: 1.8;
    color: #374151;
    margin-bottom: 48px;
}

.kb-article-body h1,
.kb-article-body h2,
.kb-article-body h3,
.kb-article-body h4 {
    margin-top: 32px;
    margin-bottom: 16px;
    color: #1F2937;
}

.kb-article-body h2 {
    font-size: 32px;
    padding-bottom: 8px;
    border-bottom: 2px solid #E5E7EB;
}

.kb-article-body h3 {
    font-size: 24px;
}

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

.kb-article-body strong,
.kb-article-body b {
    font-weight: 800;
    color: #111827;
    text-shadow: 0.5px 0 0 currentColor;
}

.kb-article-body em,
.kb-article-body i {
    font-style: italic;
}

.kb-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px auto;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Image size classes */
.kb-article-body img[alt*="width:25%"],
.kb-article-body img.w-25 {
    max-width: 25%;
}

.kb-article-body img[alt*="width:50%"],
.kb-article-body img.w-50 {
    max-width: 50%;
}

.kb-article-body img[alt*="width:75%"],
.kb-article-body img.w-75 {
    max-width: 75%;
}

.kb-article-body img[alt*="width:100%"],
.kb-article-body img.w-100 {
    max-width: 100%;
}

/* Allow custom width in alt text */
.kb-article-body img[alt*="width:"] {
    /* This will be overridden by inline styles from the renderer */
}

.kb-article-body ul,
.kb-article-body ol {
    margin-bottom: 16px;
    padding-left: 32px;
}

.kb-article-body li {
    margin-bottom: 8px;
}

.kb-article-body code {
    background: #F3F4F6;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9em;
}

.kb-article-body pre {
    background: #1F2937;
    color: #E5E7EB;
    padding: 24px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 24px;
}

.kb-article-body .code-block-wrapper {
    margin: 24px 0;
}

.kb-article-body .code-block-wrapper pre {
    margin: 0;
}

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

.kb-article-body blockquote {
    border-left: 4px solid #7C3AED;
    padding-left: 24px;
    margin: 24px 0;
    font-style: italic;
    color: #6B7280;
}

.kb-article-body a {
    color: #7C3AED;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.kb-article-body a:hover {
    border-bottom-color: #7C3AED;
}

/* Related Articles */
.kb-related-articles {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 1px solid #E5E7EB;
}

.kb-related-articles h3 {
    font-size: 24px;
    margin-bottom: 24px;
    color: #1F2937;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.related-item {
    background: #F9FAFB;
    padding: 24px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.related-item:hover {
    background: #F3F4F6;
    transform: translateY(-2px);
}

.related-item h4 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #1F2937;
}

.related-item p {
    color: #6B7280;
    font-size: 14px;
    line-height: 1.6;
}

/* Feedback Section */
.kb-article-feedback {
    margin-top: 48px;
    padding: 32px;
    background: #F9FAFB;
    border-radius: 12px;
    text-align: center;
}

.kb-article-feedback h3 {
    font-size: 20px;
    margin-bottom: 16px;
    color: #1F2937;
}

.feedback-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.feedback-btn {
    padding: 12px 32px;
    border: 2px solid #E5E7EB;
    background: white;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.feedback-btn:hover {
    transform: translateY(-2px);
}

.feedback-btn.helpful:hover {
    background: #10B981;
    color: white;
    border-color: #10B981;
}

.feedback-btn.not-helpful:hover {
    background: #EF4444;
    color: white;
    border-color: #EF4444;
}

.feedback-thanks {
    color: #10B981;
    font-size: 18px;
    font-weight: 500;
}

/* KB Home Hero Section */
.kb-hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

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

.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: 50px 50px;
}

.kb-hero .container {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.kb-hero .hero-content {
    text-align: center;
}

.kb-hero .hero-title {
    font-size: 56px;
    font-weight: 100; /* Ultra-thin weight */
    font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-bottom: 24px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.kb-hero .hero-subtitle {
    font-size: 24px;
    font-weight: 300;
    margin-bottom: 48px;
    opacity: 0.9;
}

/* KB Search Box */
.kb-search {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.kb-search-input {
    width: 100%;
    padding: 16px 24px 16px 56px;
    font-size: 18px;
    border: none;
    border-radius: 50px;
    background: white;
    color: #1F2937;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.kb-search-input:focus {
    outline: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
}

.kb-search-input::placeholder {
    color: #9CA3AF;
}

.kb-search .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #6B7280;
    pointer-events: none;
}

/* Article Hero Section */
.kb-article-hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

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

.kb-article-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: 50px 50px;
}

@keyframes rotate {
    to { transform: rotate(360deg); }
}

.kb-article-hero .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.kb-article-hero .hero-content {
    position: relative;
    z-index: 2;
}

.kb-article-hero .kb-breadcrumb {
    opacity: 0.9;
}

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

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

.kb-article-hero .kb-breadcrumb .separator {
    color: rgba(255, 255, 255, 0.6);
    margin: 0 8px;
}

.kb-article-hero .kb-breadcrumb .current {
    color: rgba(255, 255, 255, 0.8);
}

.article-hero-title {
    font-size: 48px;
    font-weight: 100; /* Ultra-thin weight */
    font-family: 'Avenir Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-bottom: 32px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.article-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
}

.article-hero-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
}

.article-hero-meta svg {
    opacity: 0.8;
}

.article-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.hero-tag {
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.hero-tag:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-1px);
}

.article-hero-actions {
    margin-top: 32px;
}

.hero-edit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.hero-edit-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

/* Update article container */
.kb-article {
    background: white;
    margin-top: -40px;
    position: relative;
    z-index: 2;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.kb-article .container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 40px;
}

/* Remove old header styles */
.kb-article-header {
    display: none;
}

/* Error States */
.kb-error {
    text-align: center;
    padding: 80px 20px;
}

.kb-error h1 {
    font-size: 36px;
    color: #1F2937;
    margin-bottom: 16px;
}

.kb-error p {
    font-size: 18px;
    color: #6B7280;
    margin-bottom: 32px;
}

.kb-error .btn {
    display: inline-block;
    padding: 12px 32px;
    background: #7C3AED;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.kb-error .btn:hover {
    background: #6D28D9;
    transform: translateY(-2px);
}

/* Articles Section */
.kb-articles-section {
    padding: 80px 0;
    background: #F9FAFB;
}

.kb-articles-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.kb-articles-section .section-title {
    font-size: 36px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 48px;
    text-align: center;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 32px;
}

/* Article Card */
.article-card {
    background: white;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #6B7280;
}

.article-category {
    background: #F3F4F6;
    color: #4B5563;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
}

.article-date {
    color: #9CA3AF;
}

.article-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.article-title a {
    color: #1F2937;
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:hover {
    color: #7C3AED;
}

.article-excerpt {
    color: #4B5563;
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
}

.article-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #7C3AED;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.article-link:hover {
    gap: 12px;
    color: #6B21A8;
}

.article-link svg {
    transition: transform 0.2s ease;
}

.article-link:hover svg {
    transform: translateX(4px);
}

/* Popular Tags Section */
.kb-popular-tags {
    padding: 60px 0;
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.kb-popular-tags h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 32px;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
}

.tag-item {
    display: inline-block;
    padding: 8px 20px;
    background: #F3F4F6;
    color: #4B5563;
    border-radius: 24px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

.tag-item:hover {
    background: #7C3AED;
    color: white;
    transform: scale(1.05);
}

/* Responsive Design */
@media (max-width: 768px) {
    .kb-hero h1 {
        font-size: 36px;
    }
    
    .kb-hero p {
        font-size: 18px;
    }
    
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .article-card {
        padding: 24px;
    }
    
    .article-title {
        font-size: 20px;
    }
    
    .kb-articles-section .section-title {
        font-size: 28px;
    }
    
    .kb-article-hero {
        padding: 80px 0 60px;
    }
    
    .article-hero-title {
        font-size: 36px;
    }
    
    .article-hero-meta {
        font-size: 14px;
        gap: 16px;
    }
    
    .article-hero-meta .meta-item {
        font-size: 14px;
    }
    
    .kb-article .container {
        padding: 40px 24px;
    }
    
    .kb-article-body {
        font-size: 16px;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
}
