/**
 * Knowledge Hub Public Styles
 */

/* ========================================
   Hero Section
   ======================================== */

.kh-hero {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 50%, #93c5fd 100%);
    padding: 8rem 0 4rem;
    text-align: center;
    margin-top: 20px;
}

.kh-hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #368BC1;
}

.kh-hero-subtitle {
    font-size: 1.25rem;
    color: #475569;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   Category Tabs
   ======================================== */

.kh-categories {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.kh-category-tabs {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
}

.kh-category-tabs::-webkit-scrollbar {
    display: none;
}

.kh-category-tab {
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    background: #f3f4f6;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.kh-category-tab:hover {
    background: #e5e7eb;
    color: #368BC1;
}

.kh-category-tab.active {
    background: #368BC1;
    color: white;
}

/* Tab Count Badge */
.kh-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
    margin-left: 6px;
    background: #d1d5db;
    color: #4b5563;
}

.kh-category-tab.active .kh-tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* ========================================
   Articles Section
   ======================================== */

.kh-articles {
    padding: 4rem 0;
    background: #f9fafb;
    min-height: 50vh;
}

.kh-articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* ========================================
   Article Card
   ======================================== */

.kh-article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

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

.kh-article-image {
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f3f4f6;
}

.kh-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.kh-article-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
}

.kh-article-image--placeholder svg {
    width: 48px;
    height: 48px;
}

.kh-article-content {
    padding: 1.5rem;
}

.kh-article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.75rem;
}

.kh-article-category {
    color: #368BC1;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kh-article-reading-time {
    color: #6b7280;
}

.kh-article-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

.kh-article-title a {
    color: #111827;
    text-decoration: none;
}

.kh-article-title a:hover {
    color: #368BC1;
}

.kh-article-excerpt {
    color: #6b7280;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kh-article-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.kh-article-date {
    color: #9ca3af;
    font-size: 0.8125rem;
}

.kh-article-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #368BC1;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
}

.kh-article-link:hover {
    color: #2a6d96;
}

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

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

/* ========================================
   Empty State
   ======================================== */

.kh-empty {
    text-align: center;
    padding: 4rem 2rem;
    color: #6b7280;
}

.kh-empty svg {
    margin-bottom: 1.5rem;
    color: #9ca3af;
}

.kh-empty h3 {
    font-size: 1.5rem;
    color: #111827;
    margin-bottom: 0.5rem;
}

/* ========================================
   Pagination
   ======================================== */

.kh-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 3rem;
}

.kh-pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 1.5px solid #368BC1;
    border-radius: 12px;
    color: #368BC1;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.kh-pagination-btn:hover {
    background: #368BC1;
    color: white;
    transform: translateY(-2px);
}

.kh-pagination-info {
    color: #6b7280;
    font-size: 0.875rem;
}

/* ========================================
   CTA Section
   ======================================== */

.kh-cta {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 50%, #93c5fd 100%);
    padding: 4rem 0;
    text-align: center;
}

.kh-cta-content h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: #368BC1;
}

.kh-cta-content p {
    font-size: 1.125rem;
    color: #475569;
    margin-bottom: 1.5rem;
}

/* ========================================
   Single Article Page
   ======================================== */

.kh-article-header {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 50%, #93c5fd 100%);
    padding: 8rem 0 3rem;
    margin-top: 20px;
}

.kh-breadcrumb {
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.kh-breadcrumb a {
    color: #64748b;
    text-decoration: none;
}

.kh-breadcrumb a:hover {
    color: #1e293b;
}

.kh-breadcrumb-sep {
    margin: 0 0.5rem;
    color: #94a3b8;
}

.kh-article-page-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    max-width: 800px;
    color: #368BC1;
}

.kh-article-page-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9375rem;
    color: #475569;
}

.kh-article-page-meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Article Main Layout */
.kh-article-main {
    padding: 4rem 0;
    background: #f9fafb;
}

.kh-article-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    align-items: start;
}

/* Article Body */
.kh-article-body {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kh-article-featured-image {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.kh-article-text {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #374151;
}

.kh-article-text h2 {
    font-size: 1.75rem;
    color: #111827;
    margin: 2rem 0 1rem;
}

.kh-article-text h3 {
    font-size: 1.375rem;
    color: #111827;
    margin: 1.5rem 0 0.75rem;
}

.kh-article-text p {
    margin-bottom: 1.25rem;
}

.kh-article-text ul,
.kh-article-text ol {
    margin: 1rem 0 1.25rem 1.5rem;
}

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

.kh-article-text blockquote {
    border-left: 4px solid #368BC1;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #4b5563;
}

.kh-article-text a {
    color: #368BC1;
}

.kh-article-text strong {
    color: #111827;
}

/* Share Section */
.kh-share {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.kh-share-label {
    font-weight: 500;
    color: #374151;
}

.kh-share-buttons {
    display: flex;
    gap: 0.75rem;
}

.kh-share-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.kh-share-btn:hover {
    border-color: transparent;
}

.kh-share-btn--twitter:hover {
    background: #1da1f2;
    color: white;
}

.kh-share-btn--facebook:hover {
    background: #1877f2;
    color: white;
}

.kh-share-btn--linkedin:hover {
    background: #0a66c2;
    color: white;
}

.kh-share-btn--copy:hover {
    background: #374151;
    color: white;
}

/* Sidebar */
.kh-sidebar {
    position: sticky;
    top: 100px;
}

.kh-sidebar-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.kh-sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
}

.kh-related-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.kh-related-item {
    display: block;
    padding: 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.kh-related-item:hover {
    background: #f3f4f6;
}

.kh-related-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.kh-related-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

/* Sidebar CTA */
.kh-sidebar-cta {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 50%, #93c5fd 100%);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.kh-sidebar-cta h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #368BC1;
}

.kh-sidebar-cta p {
    font-size: 0.875rem;
    color: #475569;
    margin-bottom: 1rem;
}

.kh-sidebar-cta .btn {
    background: #368BC1;
    color: white;
    box-shadow: 0 2px 8px rgba(54, 139, 193, 0.25);
}

.kh-sidebar-cta .btn:hover {
    background: #2a6d96;
    box-shadow: 0 4px 12px rgba(54, 139, 193, 0.35);
    transform: translateY(-1px);
}

/* Back Link */
.kh-back {
    background: white;
    padding: 2rem 0;
    border-top: 1px solid #e5e7eb;
}

.kh-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #368BC1;
    font-weight: 500;
    text-decoration: none;
}

.kh-back-link:hover {
    color: #2a6d96;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 1024px) {
    .kh-articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .kh-article-layout {
        grid-template-columns: 1fr;
    }

    .kh-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .kh-hero {
        padding: 6rem 0 3rem;
        margin-top: 0;
    }

    .kh-hero-title {
        font-size: 2rem;
    }

    .kh-hero-subtitle {
        font-size: 1rem;
    }

    .kh-articles-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .kh-article-header {
        padding: 4rem 0 2rem;
    }

    .kh-article-page-title {
        font-size: 1.75rem;
    }

    .kh-article-page-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .kh-article-body {
        padding: 1.5rem;
    }

    .kh-article-text {
        font-size: 1rem;
    }

    .kh-pagination {
        flex-direction: column;
        gap: 1rem;
    }
}

/* ========================================
   QOTD Section (for landing page)
   ======================================== */

.qotd-section {
    padding: 5rem 0;
    background: linear-gradient(180deg, #f0f7ff 0%, #e8f4fd 50%, #f8fafc 100%);
    position: relative;
    overflow: hidden;
}

.qotd-section::before {
    content: '';
    position: absolute;
    top: -60px;
    left: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(54, 139, 193, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.qotd-section::after {
    content: '';
    position: absolute;
    bottom: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(54, 139, 193, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.qotd-container {
    max-width: 800px;
    margin: 0 auto;
    animation: qotdSlideUp 0.6s ease-out;
}

@keyframes qotdSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.qotd-header {
    text-align: center;
    margin-bottom: 2rem;
}

.qotd-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 1.5px solid #368BC1;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #368BC1;
    margin-bottom: 1rem;
    animation: qotdPulse 2.5s ease-in-out infinite;
}

@keyframes qotdPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(54, 139, 193, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(54, 139, 193, 0); }
}

.qotd-badge svg {
    flex-shrink: 0;
}

.qotd-header h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 0.5rem;
}

.qotd-header p {
    color: #6b7280;
    font-size: 1.0625rem;
}

.qotd-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(54, 139, 193, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(54, 139, 193, 0.1);
}

.qotd-category {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: #eff6ff;
    color: #368BC1;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.qotd-question {
    font-size: 1.25rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.qotd-answers {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.qotd-answer {
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    text-align: left;
}

.qotd-answer:hover {
    border-color: #368BC1;
    background: #eff6ff;
}

.qotd-answer.selected {
    border-color: #368BC1;
    background: #eff6ff;
}

.qotd-answer.correct {
    border-color: #10b981;
    background: #ecfdf5;
}

.qotd-answer.incorrect {
    border-color: #ef4444;
    background: #fef2f2;
}

.qotd-answer.disabled {
    cursor: default;
    opacity: 0.85;
}

.qotd-answer.disabled:hover {
    border-color: #e5e7eb;
    background: white;
}

.qotd-answer.disabled.correct:hover {
    border-color: #10b981;
    background: #ecfdf5;
}

.qotd-answer.disabled.incorrect:hover {
    border-color: #ef4444;
    background: #fef2f2;
}

.qotd-answer-letter {
    font-weight: 700;
    margin-right: 0.5rem;
    color: #368BC1;
}

.qotd-answer.correct .qotd-answer-letter {
    color: #059669;
}

.qotd-answer.incorrect .qotd-answer-letter {
    color: #dc2626;
}

.qotd-explanation {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    animation: qotdFadeIn 0.3s ease;
}

.qotd-explanation p {
    color: #166534;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
}

.qotd-explanation ul,
.qotd-explanation ol {
    color: #166534;
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.qotd-explanation li {
    margin-bottom: 0.25rem;
}

@keyframes qotdFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.qotd-footer {
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.qotd-cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #368BC1;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s ease;
}

.qotd-cta-link:hover {
    color: #2a6d96;
}

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

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

@media (max-width: 768px) {
    .qotd-section {
        padding: 3rem 0;
    }

    .qotd-header h2 {
        font-size: 1.75rem;
    }

    .qotd-card {
        padding: 1.5rem;
    }

    .qotd-question {
        font-size: 1.0625rem;
    }
}
