/* Global App Documentation Styles */

:root {
    --fiber-primary: #2196f3;
    --fiber-primary-dark: #1976d2;
    --fiber-secondary: #f8f9fa;
    --fiber-accent: #4caf50;
    --fiber-warning: #ff9800;
    --fiber-error: #f44336;
    --fiber-text: #333333;
    --fiber-text-light: #666666;
    --fiber-text-muted: #999999;
    --fiber-border: #e0e0e0;
    --fiber-bg-light: #f8f9fa;
    --fiber-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --fiber-shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --fiber-radius: 0.75rem;
    --fiber-radius-sm: 0.375rem;
}

/* App Documentation Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--fiber-primary), var(--fiber-primary-dark));
    border-radius: var(--fiber-radius);
    color: white;
    position: relative;
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 100px;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(15deg);
}

.app-title {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    z-index: 1;
}

.app-title .app-icon {
    font-size: 3.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 90px;
    height: 90px;
    border-radius: var(--fiber-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.app-title h1 {
    margin: 0;
    font-size: 2.25rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.app-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 1.125rem;
    opacity: 0.9;
    font-weight: 400;
}

.app-links {
    display: flex;
    gap: 1rem;
    z-index: 1;
}

/* Repository Info Banner */
.repo-info {
    background: var(--fiber-bg-light);
    border: 1px solid var(--fiber-border);
    border-radius: var(--fiber-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.repo-icon {
    font-size: 2rem;
    color: var(--fiber-primary);
}

.repo-details h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: var(--fiber-text);
}

.repo-path {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    background: var(--fiber-primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: var(--fiber-radius-sm);
    font-size: 0.875rem;
    margin: 0 0 0.5rem 0;
    display: inline-block;
}

.repo-links {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.repo-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--fiber-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--fiber-primary);
    border-radius: var(--fiber-radius-sm);
    transition: all 0.2s;
}

.repo-link:hover {
    background: var(--fiber-primary);
    color: white;
    transform: translateY(-1px);
}

/* File Path Headers */
.file-header {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 1rem 1.5rem;
    border-radius: var(--fiber-radius-sm) var(--fiber-radius-sm) 0 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.file-path {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.file-path-icon {
    color: #569cd6;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-link {
    color: #9cdcfe;
    text-decoration: none;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #4a4a4a;
    border-radius: 3px;
    transition: all 0.2s;
}

.file-link:hover {
    background: #4a4a4a;
    color: white;
}

/* Enhanced Code Blocks */
.code-section {
    margin: 1.5rem 0;
}

.code-section .code-block {
    border-radius: 0 0 var(--fiber-radius-sm) var(--fiber-radius-sm);
    margin-top: 0;
}

/* Feature and Component Grids */
.feature-grid, .agent-grid, .component-grid, .customization-grid, .example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.feature-card, .agent-card, .component-card, .custom-card, .example-card {
    background: white;
    border: 1px solid var(--fiber-border);
    border-radius: var(--fiber-radius);
    padding: 2rem;
    box-shadow: var(--fiber-shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-card:hover, .agent-card:hover, .component-card:hover, .custom-card:hover, .example-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--fiber-shadow-lg);
    border-color: var(--fiber-primary);
}

.feature-card::before, .agent-card::before, .component-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--fiber-primary), var(--fiber-accent));
}

.feature-card h3, .agent-card h3, .component-card h3, .custom-card h3, .example-card h3 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--fiber-text);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-card h3::before, .agent-card h3::before, .component-card h3::before {
    font-size: 1.5rem;
}

/* Agent Type Badges */
.agent-type {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--fiber-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.agent-type.llm {
    background: var(--fiber-accent);
}

.agent-type.custom {
    background: var(--fiber-warning);
}

/* Install Methods */
.install-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.install-method {
    background: white;
    border: 1px solid var(--fiber-border);
    border-radius: var(--fiber-radius);
    padding: 2rem;
    box-shadow: var(--fiber-shadow);
}

.install-method h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1rem 0;
    color: var(--fiber-primary);
    font-weight: 600;
}

/* Enhanced Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--fiber-radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--fiber-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.btn-primary:hover {
    background: var(--fiber-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

.btn-secondary {
    background: var(--fiber-bg-light);
    color: var(--fiber-text);
    border: 1px solid var(--fiber-border);
}

.btn-secondary:hover {
    background: white;
    transform: translateY(-1px);
    box-shadow: var(--fiber-shadow);
}

.btn-outline {
    background: transparent;
    color: var(--fiber-primary);
    border: 1px solid var(--fiber-primary);
}

.btn-outline:hover {
    background: var(--fiber-primary);
    color: white;
}

/* Documentation Navigation */
.doc-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding: 2rem;
    background: var(--fiber-bg-light);
    border-radius: var(--fiber-radius);
    border: 1px solid var(--fiber-border);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--fiber-primary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--fiber-radius-sm);
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--fiber-primary);
    color: white;
    transform: translateX(4px);
}

.nav-link.back:hover {
    transform: translateX(-4px);
}

/* Architecture Diagrams */
.architecture-diagram {
    background: white;
    border: 1px solid var(--fiber-border);
    border-radius: var(--fiber-radius);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--fiber-shadow);
}

.architecture-diagram h3 {
    margin: 0 0 1rem 0;
    color: var(--fiber-primary);
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }

    .app-title {
        flex-direction: column;
        text-align: center;
    }

    .install-methods, .feature-grid, .agent-grid, .component-grid, .customization-grid, .example-grid {
        grid-template-columns: 1fr;
    }

    .repo-info {
        flex-direction: column;
        text-align: center;
    }

    .repo-links {
        justify-content: center;
    }

    .doc-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .file-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* Table of Contents Styling */
.toc-section {
    background: var(--fiber-bg-light);
    border: 1px solid var(--fiber-border);
    border-radius: var(--fiber-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.toc-section h3 {
    margin: 0 0 1rem 0;
    color: var(--fiber-primary);
    font-weight: 600;
}

.toc-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    padding: 0.5rem;
    border-radius: var(--fiber-radius-sm);
    transition: background-color 0.2s;
}

.toc-item:hover {
    background: rgba(33, 150, 243, 0.1);
}

.toc-item a {
    color: var(--fiber-text);
    text-decoration: none;
    font-weight: 500;
}

.toc-item a:hover {
    color: var(--fiber-primary);
}

/* Building Block Cards */
.featured-building-block {
    position: relative;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px solid var(--fiber-primary);
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.15);
}

.featured-building-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--fiber-primary), var(--fiber-accent));
}

.building-block-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--fiber-primary);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin: 0.5rem 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.featured-building-block.coming-soon {
    opacity: 0.8;
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 100%);
    border-color: #ccc;
}

.featured-building-block.coming-soon .building-block-badge {
    background: #666;
}

.coming-soon-label {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: #666;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Building Block Progression */
.building-block-progression {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin: 2rem 0;
    padding: 2rem;
    background: var(--fiber-bg-light);
    border-radius: var(--fiber-radius);
    overflow-x: auto;
}

.block-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 300px;
    padding: 1.5rem;
    background: white;
    border-radius: var(--fiber-radius);
    box-shadow: var(--fiber-shadow);
}

.block-item.current {
    border: 2px solid var(--fiber-primary);
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.2);
}

.block-item.future {
    opacity: 0.7;
}

.block-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--fiber-primary);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.block-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
}

.block-content p {
    margin: 0 0 1rem 0;
    font-weight: 600;
    color: var(--fiber-primary);
}

.block-content ul {
    margin: 0;
    padding-left: 1rem;
}

.block-arrow {
    font-size: 2rem;
    color: var(--fiber-primary);
    font-weight: bold;
    flex-shrink: 0;
}

.learning-path {
    background: var(--fiber-accent);
    color: white;
    padding: 1.5rem;
    border-radius: var(--fiber-radius);
    margin-top: 1rem;
}

.learning-path h3 {
    margin: 0 0 0.5rem 0;
}

.learning-path p {
    margin: 0;
}

/* SDK Integration Notes */
.sdk-integration-note {
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border: 1px solid var(--fiber-primary);
    border-radius: var(--fiber-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.sdk-integration-note h4 {
    margin: 0 0 1rem 0;
    color: var(--fiber-primary);
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sdk-integration-note p {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.6;
}

.sdk-integration-note code {
    background: rgba(33, 150, 243, 0.1);
    color: var(--fiber-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
}

/* SDK Examples Grid */
.sdk-examples-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

/* Resource Grid */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.resource-card {
    background: white;
    border: 1px solid var(--fiber-border);
    border-radius: var(--fiber-radius);
    padding: 1.5rem;
    box-shadow: var(--fiber-shadow);
    transition: all 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--fiber-shadow-lg);
    border-color: var(--fiber-primary);
}

.resource-card h4 {
    margin: 0 0 1rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--fiber-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.resource-card ul {
    margin: 0;
    padding-left: 1.25rem;
}

.resource-card li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.resource-card li:last-child {
    margin-bottom: 0;
}

.resource-card strong {
    color: var(--fiber-text);
    font-weight: 600;
}

.resource-card a {
    color: var(--fiber-primary);
    text-decoration: none;
    font-weight: 500;
}

.resource-card a:hover {
    text-decoration: underline;
}

.sdk-example {
    border: 1px solid var(--fiber-border);
    border-radius: var(--fiber-radius);
    overflow: hidden;
    box-shadow: var(--fiber-shadow);
}

.sdk-example .file-header {
    background: #2a2a2a;
    color: #d4d4d4;
    padding: 1rem 1.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    border-bottom: none;
}

.sdk-example .code-block {
    margin: 0;
    border-radius: 0;
    border: none;
}

.sdk-example .code-block pre {
    margin: 0;
}

/* Building Block Navigation in Sidebar */
.building-blocks-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--fiber-border);
}

.building-blocks-nav-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--fiber-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--fiber-border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.building-blocks-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.building-block-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--fiber-radius-sm);
    text-decoration: none;
    color: var(--fiber-text);
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 0.875rem;
}

.building-block-nav-item:hover {
    background: var(--fiber-bg-light);
    border-color: var(--fiber-border);
}

.building-block-nav-item.current {
    background: linear-gradient(135deg, var(--fiber-primary), var(--fiber-primary-dark));
    color: white;
    border-color: var(--fiber-primary);
}

.building-block-nav-item.current:hover {
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

.building-block-nav-item.coming-soon {
    opacity: 0.6;
    cursor: not-allowed;
}

.building-block-nav-item.coming-soon:hover {
    background: transparent;
    border-color: transparent;
}

.nav-block-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--fiber-bg-light);
    color: var(--fiber-text);
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.building-block-nav-item.current .nav-block-number {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.building-block-nav-item.coming-soon .nav-block-number {
    background: #e0e0e0;
    color: #999;
}

.nav-block-content {
    flex: 1;
}

.nav-block-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin: 0 0 0.125rem 0;
}

.nav-block-desc {
    font-size: 0.7rem;
    opacity: 0.8;
    margin: 0;
    line-height: 1.2;
}

.building-block-nav-item.current .nav-block-desc {
    opacity: 0.9;
}

/* Responsive adjustments for building blocks */
@media (max-width: 768px) {
    .building-blocks-section {
        margin-top: 1rem;
        padding-top: 1rem;
    }
    
    .building-block-nav-item {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .nav-block-number {
        width: 20px;
        height: 20px;
        font-size: 0.6rem;
    }
}

/* Overview Highlight Section */
.overview-highlight {
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
    border: 1px solid var(--fiber-primary);
    border-radius: var(--fiber-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.overview-highlight h3 {
    margin: 0 0 1rem 0;
    color: var(--fiber-primary);
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.overview-highlight ul {
    margin: 0;
    padding-left: 1.25rem;
}

.overview-highlight li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.overview-highlight li:last-child {
    margin-bottom: 0;
}

.overview-highlight strong {
    color: var(--fiber-text);
    font-weight: 600;
}

/* Prerequisites Section */
.prerequisites-section {
    background: var(--fiber-bg-light);
    border: 1px solid var(--fiber-border);
    border-radius: var(--fiber-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.prerequisites-section h3 {
    margin: 0 0 1rem 0;
    color: var(--fiber-primary);
    font-size: 1.125rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prerequisites-section ul {
    margin: 0;
    padding-left: 1.25rem;
}

.prerequisites-section li {
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

.prerequisites-section li:last-child {
    margin-bottom: 0;
}

.prerequisites-section strong {
    color: var(--fiber-text);
    font-weight: 600;
}

@media (max-width: 768px) {
    .sdk-examples-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}