/* retoor <retoor@molodetz.nl> */

.playground-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 100%;
}

.playground-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.75rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px 4px 0 0;
}

.playground-toolbar button {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.15s ease;
}

.playground-toolbar button:hover:not(:disabled) {
    background: #e9e9e9;
}

.playground-toolbar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.playground-toolbar button.primary {
    background: #4a90d9;
    color: white;
    border-color: #3a7bc8;
}

.playground-toolbar button.primary:hover:not(:disabled) {
    background: #3a7bc8;
}

.playground-toolbar select {
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    font-size: 0.875rem;
    min-width: 150px;
}

.wasm-status {
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.wasm-status.loading {
    background: #fff3cd;
    color: #856404;
}

.wasm-status.ready {
    background: #d4edda;
    color: #155724;
}

.wasm-status.error {
    background: #f8d7da;
    color: #721c24;
}

.playground-editor-wrapper {
    position: relative;
}

#wren-editor {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', monospace;
    font-size: 14px;
    line-height: 1.5;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0;
    resize: vertical;
    background: #fafafa;
    color: #333;
    tab-size: 2;
    box-sizing: border-box;
}

#wren-editor:focus {
    outline: none;
    background: #fff;
    border-color: #4a90d9;
}

.output-panel {
    border: 1px solid #333;
    border-radius: 0 0 4px 4px;
    background: #1e1e1e;
    overflow: hidden;
}

.output-header {
    padding: 0.5rem 1rem;
    background: #2d2d2d;
    color: #ccc;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #444;
}

#wren-output {
    min-height: 150px;
    max-height: 300px;
    padding: 1rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #d4d4d4;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#wren-output .output-output {
    color: #d4d4d4;
}

#wren-output .output-error {
    color: #f48771;
}

#wren-output .output-info {
    color: #6a9955;
    font-style: italic;
}

.playground-help {
    margin-top: 0.5rem;
    padding: 0.75rem 1rem;
    background: #e8f4fd;
    border: 1px solid #b6d4fe;
    border-radius: 4px;
    font-size: 0.875rem;
    color: #084298;
}

.playground-help kbd {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    font-family: inherit;
    font-size: 0.8rem;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 3px;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

.modules-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.module-badge {
    display: inline-block;
    padding: 0.4rem 0.75rem;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875rem;
    color: #555;
    text-align: center;
}

@media (max-width: 768px) {
    .playground-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .wasm-status {
        margin-left: 0;
        text-align: center;
    }

    #wren-editor {
        min-height: 200px;
        font-size: 13px;
    }

    #wren-output {
        min-height: 100px;
        font-size: 12px;
    }
}
