/* Story-specific styles */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --accent: #06b6d4;
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-elevated: #252525;
    --text-primary: #e5e7eb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border: #2a2a2a;
    --border-light: #333333;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
}

.story-container {
    display: flex;
    min-height: 100vh;
    background: var(--bg-dark);
}

.story-nav {
    width: 300px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 2rem;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.story-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    background: var(--bg-elevated);
    height: 4px;
    border-radius: 2px;
    margin-bottom: 2rem;
    position: relative;
}

.progress-fill {
    background: var(--primary);
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 20%;
}

.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.progress-step:hover {
    background: var(--bg-elevated);
}

.progress-step.active {
    background: rgba(59, 130, 246, 0.1);
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.progress-step.active .step-number {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.step-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-step.active .step-label {
    color: var(--text-primary);
}

.story-content {
    flex: 1;
    margin-left: 300px;
    padding: 2rem;
    background: var(--bg-dark);
    color: var(--text-primary);
}

.story-section {
    display: none;
    max-width: 800px;
    margin: 0 auto;
}

.story-section.active {
    display: block;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.section-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.section-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.section-content h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--dark);
}

.section-content p {
    font-size: 1.125rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    color: var(--gray);
}

/* Business Metrics */
.business-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.metric-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid var(--border);
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Code Blocks */
.code-block {
    background: #1a1b26;
    border-radius: 8px;
    overflow: hidden;
    margin: 1.5rem 0;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #16161e;
    color: #a9b1d6;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
}

.copy-btn {
    background: none;
    border: none;
    color: #a9b1d6;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.copy-btn:hover {
    background: #2a2b3a;
}

pre {
    margin: 0;
    padding: 1.5rem;
    color: #c0caf5;
    font-family: 'Monaco', 'Consolas', monospace;
    line-height: 1.5;
    overflow-x: auto;
    font-size: 0.875rem;
}

/* Architecture Diagrams */
.architecture-diagram {
    margin: 2rem 0;
}

.diagram {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1rem;
}

.diagram-title {
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.diagram-flow {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.diagram-node {
    background: var(--bg-elevated);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    border: 2px solid var(--border);
    min-width: 120px;
    color: var(--text-primary);
}

.diagram-node.problem {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.diagram-node.success {
    border-color: var(--accent);
    background: rgba(6, 182, 212, 0.1);
}

.diagram-arrow {
    font-size: 1.5rem;
    color: var(--text-secondary);
    font-weight: bold;
}

/* Problem List */
.problem-list {
    margin: 2rem 0;
}

.problem-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.problem-icon {
    font-size: 1.25rem;
}

.problem-content {
    flex: 1;
}

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

.feature-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    text-align: center;
}

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

.feature-card h4 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Business Impact */
.business-impact {
    margin: 2rem 0;
}

.impact-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.impact-metric {
    text-align: center;
    padding: 1.5rem;
}

.impact-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.impact-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Code Tabs */
.code-tabs {
    margin: 2rem 0;
}

.tab-buttons {
    display: flex;
    background: var(--bg-elevated);
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.tab-button {
    flex: 1;
    padding: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.3s;
}

.tab-button:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.tab-button.active {
    background: #1a1b26;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Download Section */
.download-section {
    background: rgba(6, 182, 212, 0.1);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid var(--accent);
    margin: 2rem 0;
    text-align: center;
}

.download-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

/* Results Showcase */
.results-showcase {
    display: grid;
    gap: 1.5rem;
    margin: 2rem 0;
}

.result-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.result-icon {
    font-size: 3rem;
}

.result-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.result-content p {
    margin: 0;
    color: var(--text-secondary);
}

/* Production Secrets */
.production-secrets {
    margin: 3rem 0;
}

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

.secret-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

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

.secret-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.secret-header h4 {
    margin: 0;
    color: var(--text-primary);
}

.secret-indicator {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.secret-content {
    display: none;
    color: var(--text-secondary);
    line-height: 1.6;
}

.secret-card.revealed .secret-content {
    display: block;
}

.secret-card.revealed .secret-indicator {
    display: none;
}

/* CTA Section */
.cta-section {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    color: var(--text-primary);
    margin: 3rem 0;
}

.cta-section h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.cta-section p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.cta-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Navigation Actions */
.navigation-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .story-container {
        flex-direction: column;
    }
    
    .story-nav {
        position: static;
        width: 100%;
        height: auto;
    }
    
    .story-content {
        margin-left: 0;
    }
    
    .progress-steps {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .progress-step {
        flex-direction: column;
        text-align: center;
        min-width: 80px;
    }
    
    .step-label {
        font-size: 0.75rem;
    }
    
    .diagram-flow {
        flex-direction: column;
    }
    
    .diagram-arrow {
        transform: rotate(90deg);
    }
    
    .navigation-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .cta-actions {
        flex-direction: column;
    }
}
