/* Playground styles - uses site CSS variables */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Playground layout */
.playground {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    flex: 1;
    min-height: 0;
}

@media (max-width: 900px) {
    .playground {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }

    .keyboard-hint {
        display: none;
    }
}

/* Sections */
.editor-section,
.output-section {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 400px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 500;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Examples select */
.examples-select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    outline: none;
    min-width: 180px;
}

.examples-select:hover {
    border-color: var(--accent);
}

.examples-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.3);
}

.examples-select option {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Controls */
.controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.keyboard-hint {
    color: var(--text-secondary);
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-primary);
    border-radius: 3px;
    border: 1px solid var(--border);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn svg {
    flex-shrink: 0;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-primary:disabled {
    background-color: var(--text-secondary);
    cursor: not-allowed;
    opacity: 0.7;
}

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

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

/* Code editor */
#code {
    flex: 1;
    padding: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: none;
    resize: none;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    tab-size: 4;
}

#code:focus {
    outline: none;
}

#code::placeholder {
    color: var(--text-secondary);
}

/* Output */
.output-content {
    flex: 1;
    padding: 1rem;
    background-color: var(--bg-primary);
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
}

.output-content:empty::before {
    content: 'Output will appear here...';
    color: var(--text-secondary);
    font-style: italic;
}

/* Status indicator */
.status {
    font-size: 0.8rem;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 500;
}

.status.loading {
    color: var(--warning);
    background-color: rgba(210, 153, 34, 0.15);
}

.status.success {
    color: var(--success);
    background-color: rgba(63, 185, 80, 0.15);
}

.status.error {
    color: var(--error);
    background-color: rgba(248, 81, 73, 0.15);
}

/* Output line styling */
.output-line {
    margin: 0;
    padding: 2px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.output-log {
    color: var(--text-primary);
}

.output-info {
    color: var(--accent);
}

.output-debug {
    color: var(--text-secondary);
}

.output-warn {
    color: var(--warning);
}

.output-error {
    color: var(--error);
}

.output-clear {
    color: var(--text-secondary);
    font-style: italic;
    border-top: 1px dashed var(--border);
    border-bottom: 1px dashed var(--border);
    padding: 4px 0;
    margin: 4px 0;
}

.output-result {
    color: var(--success);
    border-top: 1px solid var(--border);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    font-weight: 500;
}

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

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

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

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

/* Selection styling */
::selection {
    background-color: var(--accent);
    color: white;
}

/* Focus visible for accessibility */
.btn:focus-visible,
.examples-select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
