/* Component-specific styles */

/* Examples Bar */
.examples-bar {
    background: #f7fafc;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.examples-bar label {
    font-weight: 600;
    color: #2d3748;
    margin-right: 10px;
}

.example-select {
    padding: 8px 12px;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 200px;
}

/* Code Section */
.code-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.code-header {
    background: #edf2f7;
    padding: 12px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header h3 {
    color: #2d3748;
    font-size: 16px;
    font-weight: 600;
}

/* Buttons */
.button {
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.button-primary {
    background: #4299e1;
    color: white;
}

.button-primary:hover:not(:disabled) {
    background: #3182ce;
    transform: translateY(-1px);
}

.button-primary:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.button-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.button-secondary:hover {
    background: #cbd5e0;
}

.button-icon {
    font-size: 12px;
}

/* Legacy run-button class for backwards compatibility */
.run-button {
    background: #4299e1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.run-button:hover:not(:disabled) {
    background: #3182ce;
    transform: translateY(-1px);
}

.run-button:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff40;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Execution Status */
.execution-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.status-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.execution-status.running {
    background: #ddd6fe;
    color: #7c3aed;
}

.execution-status.success {
    background: #d1fae5;
    color: #059669;
}

.execution-status.error {
    background: #fee2e2;
    color: #dc2626;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    background: url('/images/loading.svg') center/contain no-repeat;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Editor Container */
.editor-container {
    flex: 1;
    position: relative;
}

/* Tabs */
.output-header {
    background: #edf2f7;
    padding: 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
}

.tab-button {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    color: #718096;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    flex: 1;
}

.tab-button.active {
    color: #2d3748;
    border-bottom-color: #4299e1;
    background: #f7fafc;
}

.tab-button:hover:not(.active) {
    background: #edf2f7;
    color: #4a5568;
}

/* Output */
#output-container {
    flex: 1;
    position: relative;
}

.output-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a202c;
    color: #e2e8f0;
    font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 14px;
    padding: 20px;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* Output elements styling */
#output, #generated-code {
    background: #1a202c;
    color: #e2e8f0;
    font-family: 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    font-size: 14px;
    padding: 20px;
    margin: 0;
    border: none;
    white-space: pre-wrap;
    overflow-y: auto;
    height: 100%;
    width: 100%;
}

#output.success {
    color: #68d391;
}

#output.error {
    color: #fc8181;
}

.tab-content {
    display: none;
}

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

.output-content.success {
    color: #68d391;
}

.output-content.error {
    color: #fc8181;
}

/* Generated Code */
#generated {
    font-size: 12px;
    color: #cbd5e0;
    line-height: 1.4;
    padding: 0;
}

.generated-header {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
}

.copy-btn {
    background: #4299e1;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: #3182ce;
}

.copy-btn:active {
    background: #2c5aa0;
}

#generated-code {
    padding: 20px;
    padding-top: 40px;
    height: 100%;
    overflow-y: auto;
}