/* Documentation Styles */

/* Navigation Header */
.app-header {
    background: #2c3e50;
    color: white;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-container .logo {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    text-decoration: none;
}

.nav-container .logo:hover {
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 1rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-links a.active {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-auth {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
}

/* Landing page */
.docs-landing {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.docs-hero {
    text-align: center;
    padding: 3rem 0 2rem;
}

.docs-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.docs-hero p {
    font-size: 1.25rem;
    color: #2c3e50;
}

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

.doc-card {
    background: white;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 2rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.doc-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #0366d6;
    transform: translateY(-2px);
}

.doc-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.doc-card p {
    color: #586069;
    line-height: 1.6;
}

/* Documentation page layout */
.docs-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: calc(100vh - 60px);
}

.docs-sidebar {
    width: 260px;
    background: #f6f8fa;
    border-right: 1px solid #e1e4e8;
    padding: 2rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.docs-sidebar h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.docs-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.docs-category h3 {
    font-size: 0.875rem;
    text-transform: uppercase;
    color: #6a737d;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.docs-category a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: #0366d6;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.docs-category a:hover {
    background: rgba(3, 102, 214, 0.1);
}

.docs-category a.active {
    background: rgba(3, 102, 214, 0.15);
    font-weight: 500;
}

.docs-content {
    flex: 1;
    padding: 2rem 3rem;
    max-width: 900px;
}

.doc-article {
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.95);
}

.doc-article h1 {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.98);
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
}

.doc-article h2 {
    font-size: 1.75rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.98);
}

.doc-article h3 {
    font-size: 1.375rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: rgba(255, 255, 255, 0.98);
}

.doc-article p {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.90);
}

.doc-article ul, .doc-article ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.doc-article li {
    margin-bottom: 0.5rem;
}

.doc-article code {
    background: rgba(0, 0, 0, 0.15);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9em;
    color: #ff9ecd;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.doc-article pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.doc-article pre {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.doc-article blockquote {
    border-left: 4px solid #0366d6;
    padding-left: 1rem;
    color: #6a737d;
    margin: 1rem 0;
}

/* Runnable code snippets */
.runnable-snippet {
    margin: 1.5rem 0;
    border: 1px solid #d1d5da;
    border-radius: 8px;
    overflow: hidden;
    background: #fafbfc;
}

.snippet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f6f8fa;
    border-bottom: 1px solid #e1e4e8;
}

.snippet-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #586069;
}

.snippet-controls {
    display: flex;
    gap: 0.5rem;
}

.snippet-controls button {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid #d1d5da;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.snippet-controls button:hover {
    background: #f6f8fa;
    border-color: #959da5;
}

.copy-btn {
    padding: 0.375rem 0.5rem !important;
}

.run-btn {
    background: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

.run-btn:hover {
    background: #218838 !important;
    border-color: #1e7e34 !important;
}

.run-btn:disabled {
    background: #94d3a2 !important;
    border-color: #94d3a2 !important;
    cursor: not-allowed;
}

.make-trifle-btn {
    background: #0366d6 !important;
    color: white !important;
    border-color: #0366d6 !important;
}

.make-trifle-btn:hover {
    background: #0256b8 !important;
    border-color: #0256b8 !important;
}

.snippet-code {
    background: #2d2d2d;
    min-height: 80px;
    font-size: 13px;
}

/* Ace editor overrides for snippets */
.snippet-code .ace_editor {
    background: #2d2d2d;
}

.snippet-code .ace_gutter {
    background: #272727;
}

.snippet-output {
    display: none;
    background: white;
    border-top: 1px solid #e1e4e8;
}

.snippet-output[style*="display: block"] {
    display: block !important;
}

.snippet-terminal {
    padding: 1rem;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    background: #1e1e1e;
    color: #d4d4d4;
    min-height: 60px;
    max-height: 300px;
    overflow-y: auto;
}

.snippet-terminal .terminal-input-line {
    display: flex;
    align-items: center;
    gap: 4px;
}

.snippet-terminal .terminal-prompt {
    color: #d4d4d4;
    white-space: pre;
}

.snippet-terminal .terminal-input {
    background: transparent;
    border: none;
    color: #4ec9b0;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 13px;
    outline: none;
    flex: 1;
}

.snippet-terminal .terminal-input:focus {
    outline: none;
}

.snippet-terminal .terminal-input::placeholder {
    color: #666;
}

.snippet-canvas-pane {
    position: relative;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-top: 1px solid #e1e4e8;
}

.snippet-canvas {
    display: block;
    margin: 1rem auto;
    border: 1px solid #e1e4e8;
    background: white;
}

/* Modal styles for "Make Trifle" */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid #d1d5da;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.1);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.btn-primary {
    padding: 0.625rem 1.25rem;
    background: #28a745;
    color: white;
    border: 1px solid #28a745;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
}

.btn-primary:hover {
    background: #218838;
    border-color: #1e7e34;
}

.btn-secondary {
    padding: 0.625rem 1.25rem;
    background: white;
    color: #586069;
    border: 1px solid #d1d5da;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
}

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

/* Responsive design */
@media (max-width: 900px) {
    .docs-container {
        flex-direction: column;
    }

    .docs-sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #e1e4e8;
    }

    .docs-content {
        padding: 2rem 1rem;
    }
}

@media (max-width: 600px) {
    .docs-hero h1 {
        font-size: 2rem;
    }

    .docs-hero p {
        font-size: 1rem;
    }

    .doc-article h1 {
        font-size: 1.75rem;
    }

    .doc-article h2 {
        font-size: 1.5rem;
    }
}
