/* AI Knowledge Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fafafa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation styles removed to avoid overriding site header */

/* Hero Section */
.hero-kb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-kb::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    font-weight: 400;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 2.5rem;
}

.stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.stat i {
    color: #00bcd4;
    font-size: 1.2rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #00bcd4;
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,188,212,0.3);
}

.cta-button:hover {
    background: #00acc1;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,188,212,0.4);
}

/* Progress Section */
.progress-section {
    padding: 80px 0;
    background: white;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1rem;
    color: #333;
}

.section-subtitle {
    font-size: 1.2rem;
    text-align: center;
    color: #666;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.progress-path {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

.progress-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #00bcd4, #667eea);
    transform: translateX(-50%);
    z-index: 1;
}

.level-section {
    margin-bottom: 4rem;
    position: relative;
}

.level-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.level-header i {
    font-size: 2rem;
    color: #00bcd4;
    background: white;
    padding: 1rem;
    border-radius: 50%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.level-header h3 {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
}

.level-badge {
    background: #00bcd4;
    color: white;
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

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

.lesson-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.lesson-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00bcd4, #667eea);
}

.lesson-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-color: #00bcd4;
}

.lesson-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #00bcd4, #667eea);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.lesson-icon i {
    font-size: 1.5rem;
    color: white;
}

.lesson-content h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.lesson-content p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.lesson-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.lesson-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #888;
}

.lesson-meta i {
    color: #00bcd4;
}

.lesson-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    background: #f0f9ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lesson-status i {
    color: #00bcd4;
    font-size: 1.1rem;
}

.lesson-card:hover .lesson-status {
    background: #00bcd4;
}

.lesson-card:hover .lesson-status i {
    color: white;
}

/* Quick Reference */
.quick-ref {
    padding: 80px 0;
    background: #f8fafc;
}

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

.ref-card {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.ref-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.ref-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.ref-icon i {
    font-size: 2rem;
    color: white;
}

.ref-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.ref-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.ref-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #00bcd4;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ref-link:hover {
    color: #00acc1;
    gap: 0.8rem;
}

/* Glossary */
.glossary-section {
    padding: 80px 0;
    background: white;
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.glossary-item {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 10px;
    border-left: 4px solid #00bcd4;
    transition: all 0.3s ease;
}

.glossary-item:hover {
    background: #f0f9ff;
    transform: translateX(5px);
}

.glossary-item h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.glossary-item p {
    color: #666;
    line-height: 1.5;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2rem;
    position: relative;
}

.modal-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 2rem;
    max-height: 50vh;
    overflow-y: auto;
    line-height: 1.6;
}

.modal-footer {
    padding: 1.5rem 2rem;
    background: #f8fafc;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: #00bcd4;
    color: white;
}

.btn-primary:hover {
    background: #00acc1;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e2e8f0;
    color: #64748b;
}

.btn-secondary:hover {
    background: #cbd5e1;
}

/* Footer styles removed to avoid overriding site footer */

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .lesson-cards {
        grid-template-columns: 1fr;
    }
    
    .ref-grid {
        grid-template-columns: 1fr;
    }
    
    .glossary-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-footer {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lesson-card {
    animation: fadeInUp 0.6s ease forwards;
}

.lesson-card:nth-child(1) { animation-delay: 0.1s; }
.lesson-card:nth-child(2) { animation-delay: 0.2s; }
.lesson-card:nth-child(3) { animation-delay: 0.3s; }
.lesson-card:nth-child(4) { animation-delay: 0.4s; }

/* Lesson Content Styles */
.lesson-section {
    margin-bottom: 2rem;
}

/* KB Hero centering + extra top padding */
.hero-kb {
    padding: 140px 0 64px; /* more space above so it clears the fixed nav */
    scroll-margin-top: 96px; /* when linking directly here */
}
.hero-kb .hero-content {
    max-width: 1000px;
    margin: 0 auto;
}
.hero-kb .hero-text {
    text-align: center;
}
.hero-kb .hero-stats { justify-content: center; }
.hero-kb .cta-button { margin-left: auto; margin-right: auto; display: inline-flex; }

/* Level section headers (Foundation, Application, Mastery) spacing */
.progress-section .level-section .level-header {
    margin: 48px 0 28px; /* more space above and below */
}

/* Fine-tune for larger screens */
@media (min-width: 992px) {
    .hero-kb { padding-top: 160px; }
}

/* Markdown-rendered lesson typography */
.lesson-section.markdown {
    font-size: 1rem;
    color: #334155;
}
.lesson-section.markdown h1,
.lesson-section.markdown h2,
.lesson-section.markdown h3 {
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    margin: 1.25rem 0 0.75rem;
}
.lesson-section.markdown h1 { font-size: 1.8rem; }
.lesson-section.markdown h2 { font-size: 1.4rem; }
.lesson-section.markdown h3 { font-size: 1.2rem; }
.lesson-section.markdown > h1:first-child,
.lesson-section.markdown > h2:first-child,
.lesson-section.markdown > h3:first-child { margin-top: 0; }
.lesson-section.markdown p { margin: 0.75rem 0; }
.lesson-section.markdown ul,
.lesson-section.markdown ol { margin: 0.75rem 0 0.75rem 1.25rem; }
.lesson-section.markdown li { margin: 0.4rem 0; }
.lesson-section.markdown blockquote {
    background: #f8fafc;
    border-left: 4px solid #00bcd4;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
}
.lesson-section.markdown code {
    background: #f1f5f9;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 0.95em;
}
.lesson-section.markdown pre code {
    display: block;
    padding: 1rem;
}

.lesson-section h3 {
    color: #00bcd4;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lesson-section h3 i {
    font-size: 1.1rem;
}

.lesson-section p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.lesson-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.lesson-section li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.prompt-example {
    background: #f8fafc;
    border-left: 4px solid #00bcd4;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 0 8px 8px 0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.4;
}

.highlight-box {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #00bcd4;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.highlight-box h4 {
    color: #00bcd4;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.practice-box {
    background: #f0fdf4;
    border: 1px solid #22c55e;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.practice-box h4 {
    color: #22c55e;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.warning-box {
    background: #fef3cd;
    border: 1px solid #f59e0b;
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.warning-box h4 {
    color: #f59e0b;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
