* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f7fa;
}

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

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    font-size: 1.3rem;
    opacity: 0.95;
    font-weight: 300;
}

nav {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    justify-content: center;
}

nav a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
    background: rgba(255, 255, 255, 0.1);
}

nav a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Main Content */
main {
    padding: 3rem 20px;
}

section {
    background: white;
    padding: 2.5rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

h2 {
    color: #667eea;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #667eea;
}

h3 {
    color: #555;
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
}

p {
    margin-bottom: 1rem;
    color: #555;
    font-size: 1.05rem;
}

/* Chapter Grid */
.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.chapter-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.chapter-card.active {
    border-color: #667eea;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.15);
}

.chapter-card.coming-soon {
    opacity: 0.6;
}

.chapter-card:hover.active {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.25);
}

.chapter-number {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    width: fit-content;
}

.coming-soon .chapter-number {
    background: #95a5a6;
}

.chapter-card h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.chapter-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
    flex-grow: 1;
}

.badge {
    background: #e3f2fd;
    color: #1976D2;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.badge-disabled {
    background: #f5f5f5;
    color: #95a5a6;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
}

.chapter-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-primary,
.btn-secondary,
.btn-disabled {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    text-align: center;
    flex: 1;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

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

.btn-disabled {
    background: #e0e0e0;
    color: #95a5a6;
    cursor: not-allowed;
}

/* Feature Grid */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.feature-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
}

.feature-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    margin-top: 0;
    font-size: 1.2rem;
    color: #2c3e50;
}

.feature-card p {
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* Architecture Diagram */
.architecture-diagram {
    margin: 2rem 0;
    background: white;
    padding: 2rem;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
}

.architecture-diagram svg {
    width: 100%;
    height: auto;
}

/* Pattern Sections */
.pattern {
    background: #f8f9fa;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    border-left: 4px solid #50C878;
}

.pattern h3 {
    color: #50C878;
    margin-top: 0;
}

/* Code Blocks */
pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: "Monaco", "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.5;
}

code {
    font-family: "Monaco", "Courier New", monospace;
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
    color: #e74c3c;
}

pre code {
    background: none;
    padding: 0;
    color: #f8f8f2;
}

/* Info Boxes */
.info-box {
    background: #e3f2fd;
    padding: 1.5rem;
    border-radius: 8px;
    border-left: 4px solid #2196F3;
    margin: 1.5rem 0;
}

.info-box h3 {
    color: #1976D2;
    margin-top: 0;
}

.info-box ol {
    margin-left: 1.5rem;
    color: #555;
}

.info-box ol li {
    margin-bottom: 0.8rem;
}

.info-box ol li strong {
    color: #1976D2;
}

/* Component Grid */
.component-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.component-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.component-card:hover {
    border-color: #667eea;
    box-shadow: 0 3px 15px rgba(102, 126, 234, 0.2);
}

.component-card h3 {
    color: #667eea;
    margin-top: 0;
    font-size: 1.2rem;
}

.component-card code {
    display: block;
    margin-top: 0.5rem;
    background: #f8f9fa;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
}

/* Lists */
ul {
    margin-left: 2rem;
    color: #555;
}

ul li {
    margin-bottom: 0.8rem;
}

ul li strong {
    color: #e74c3c;
}

/* Highlight */
.highlight {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    margin: 1.5rem 0;
    font-size: 1.1rem;
    color: #856404;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer p {
    color: #ecf0f1;
    margin-bottom: 0.5rem;
}

footer a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: #8c9eff;
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 1rem;
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: #f8f9fa;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.breadcrumb a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #764ba2;
}

.breadcrumb span {
    color: #95a5a6;
    margin: 0 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    nav {
        flex-direction: column;
        gap: 0.5rem;
    }

    section {
        padding: 1.5rem;
    }

    .chapter-grid,
    .feature-grid,
    .component-grid {
        grid-template-columns: 1fr;
    }

    .chapter-links {
        flex-direction: column;
    }

    pre {
        font-size: 0.8rem;
        padding: 1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* SVG Text Styling */
svg text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
