@import url("markdown.css");
/* Main CSS - Activation Functions Experiment */

/* CSS Variables for theming */
:root {
    /* Light Color Palette */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-code: #f5f5f5;

    --text-primary: #212529;
    --text-secondary: #495057;
    --text-muted: #6c757d;

    /* Accent Colors */
    --accent-blue: #0d6efd;
    --accent-blue-light: #3d8bfd;
    --accent-blue-dark: #0a58ca;
    --accent-purple: #6f42c1;
    --accent-green: #198754;
    --accent-yellow: #ffc107;
    --accent-orange: #fd7e14;
    --accent-red: #dc3545;
    --accent-cyan: #0dcaf0;
    --accent-teal: #20c997;

    /* Step States */
    --step-pending: #adb5bd;
    --step-ready: #0d6efd;
    --step-running: #ffc107;
    --step-completed: #198754;
    --step-error: #dc3545;

    /* Borders */
    --border-color: #dee2e6;
    --border-light: #e9ecef;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Sidebar Width */
    --sidebar-width: 280px;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Main Container */
.simulation-container {
    display: flex;
    min-height: 100vh;
}

/* Step Sidebar */
.step-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.step-sidebar-header {
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
}

.step-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    letter-spacing: 0.3px;
}

.step-list {
    flex: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.step-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.step-item:hover {
    border-color: var(--accent-blue);
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.step-item.active {
    border-color: var(--step-ready);
    background: rgba(13, 110, 253, 0.05);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.15);
}

.step-item.running {
    border-color: var(--step-running);
    background: rgba(255, 193, 7, 0.1);
}

.step-item.running .step-indicator {
    animation: pulse 1.5s infinite;
}

.step-item.completed {
    border-color: var(--step-completed);
    background: rgba(25, 135, 84, 0.05);
}

.step-indicator {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--step-pending);
    transition: all var(--transition-normal);
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.step-item.active .step-indicator {
    border-color: var(--step-ready);
    background: var(--step-ready);
    color: white;
}

.step-item.running .step-indicator {
    border-color: var(--step-running);
    background: var(--step-running);
    color: white;
}

.step-item.completed .step-indicator {
    border-color: var(--step-completed);
    background: var(--step-completed);
    color: white;
    font-size: 0;
}

.step-item.completed .step-indicator::after {
    content: "✓";
    font-size: 0.9rem;
}

.step-content {
    flex: 1;
    min-width: 0;
    /* Text truncation fix */
}

.step-title {
    font-size: 0.85rem;
    /* Slightly smaller font to fit titles */
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.step-item.active .step-title {
    color: var(--accent-blue);
    font-weight: 600;
}

.step-item.completed .step-title {
    color: var(--step-completed);
}

/* Sidebar Footer (Buttons) */
.sidebar-footer {
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-top: auto;
}

.sidebar-footer .reset-btn,
.sidebar-footer .download-pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    width: 100%;
    /* Full width */
}

.sidebar-footer .reset-btn {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.sidebar-footer .reset-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.sidebar-footer .download-pdf-btn {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.sidebar-footer .download-pdf-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.35);
}


/* Notebook Area */
.notebook-area {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: var(--spacing-xl);
    max-width: calc(100% - var(--sidebar-width));
    background: var(--bg-primary);
}

.notebook-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 2px solid var(--border-light);
}

.notebook-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: var(--spacing-sm);
}

/* Notebook Cells */
.notebook-cell {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-sm);
    scroll-margin-top: 2rem;
}

.notebook-cell:hover {
    border-color: var(--accent-blue-light);
    box-shadow: var(--shadow-md);
}

.notebook-cell.running {
    border-color: var(--step-running);
    box-shadow: 0 0 20px rgba(255, 193, 7, 0.2);
}

.notebook-cell.completed {
    border-color: var(--step-completed);
}

.cell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-lg);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.cell-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.run-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--accent-green);
    border: none;
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.run-btn:hover {
    background: #157347;
    transform: scale(1.05);
}

.run-btn:disabled,
.run-btn.disabled {
    background: var(--step-pending);
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    pointer-events: none;
}

/* Code Block */
.cell-code {
    background: #2d2d2d;
    padding: var(--spacing-lg);
    overflow-x: auto;
}

.cell-code pre {
    margin: 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    color: #e6e6e6;
}

/* Output Area */
.cell-output {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.cell-output.hidden {
    display: none;
}

.output-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.output-content {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.85rem;
}

.text-output pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--text-primary);
    background: var(--bg-primary);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.output-image {
    margin: var(--spacing-md) 0;
    text-align: center;
}

.output-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

/* Markdown Cell Content Styling */
.markdown-cell {
    padding: 2.5rem 3rem;
    background: var(--bg-primary);
    line-height: 1.8;
}

.markdown-cell h1,
.markdown-cell h2,
.markdown-cell h3,
.markdown-cell h4,
.markdown-cell h5,
.markdown-cell h6 {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-cell h1:first-child,
.markdown-cell h2:first-child,
.markdown-cell h3:first-child,
.markdown-cell h4:first-child,
.markdown-cell h5:first-child,
.markdown-cell h6:first-child {
    margin-top: 0;
}

.markdown-cell h1 {
    font-size: 1.75rem;
    border-bottom: 2px solid var(--border-light);
    padding-bottom: var(--spacing-sm);
}

.markdown-cell h2 {
    font-size: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: var(--spacing-xs);
}

.markdown-cell h3 {
    font-size: 1.25rem;
}

.markdown-cell h4 {
    font-size: 1.1rem;
}

.markdown-cell p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.markdown-cell ul,
.markdown-cell ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-xl);
}

.markdown-cell li {
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.markdown-cell li>ul,
.markdown-cell li>ol {
    margin-top: var(--spacing-sm);
}

.markdown-cell code {
    background: var(--bg-code);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    color: var(--accent-red);
}

.markdown-cell pre {
    background: var(--bg-code);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin-bottom: var(--spacing-md);
    border: 1px solid var(--border-light);
}

.markdown-cell pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.markdown-cell blockquote {
    border-left: 4px solid var(--accent-blue);
    padding-left: var(--spacing-md);
    margin: var(--spacing-md) 0;
    color: var(--text-muted);
    font-style: italic;
}

.markdown-cell strong {
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-cell em {
    font-style: italic;
}

.markdown-cell a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.markdown-cell a:hover {
    color: var(--accent-blue-dark);
    text-decoration: underline;
}

.markdown-cell hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: var(--spacing-lg) 0;
}

.markdown-cell table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: var(--spacing-md);
}

.markdown-cell th,
.markdown-cell td {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-light);
    text-align: left;
}

.markdown-cell th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-cell td {
    color: var(--text-secondary);
}

/* Completion Message */
.completion-message {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-xl);
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(13, 110, 253, 0.1) 100%);
    border-radius: var(--radius-lg);
    border: 2px solid var(--step-completed);
    margin-top: var(--spacing-xl);
    box-shadow: var(--shadow-md);
}

.completion-message.hidden {
    display: none;
}

.completion-icon {
    font-size: 3rem;
    color: var(--accent-green);
    font-weight: bold;
}

.completion-text h3 {
    color: var(--accent-green);
    margin-bottom: var(--spacing-xs);
}

.completion-text p {
    color: var(--text-secondary);
}

/* Variant Selector (if needed later) */
.variant-selector {
    padding: var(--spacing-lg);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08) 0%, rgba(111, 66, 193, 0.08) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    border: 1px solid var(--border-light);
}

.selector-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.selector-controls {
    display: flex;
    gap: var(--spacing-lg);
    flex-wrap: wrap;
}

/* Animations */
@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cell-output:not(.hidden) {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Back Link Styles */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    transition: color var(--transition-fast);
    position: absolute;
    left: var(--spacing-xl);
    top: var(--spacing-xl);
}

.back-link:hover {
    color: var(--accent-blue);
}

.notebook-header {
    position: relative;
}