/* ============================================================================
   DEBUG PAGES STYLES
   Consistent styling for all dev-* pages (dev-device, dev-keycloak, dev-test)
   Version: 1.0.0
   ============================================================================ */

/* ========== Status Dashboard ========== */
.status-dashboard {
    margin-bottom: 2rem;
}

.status-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.status-card h2 {
    margin: 0 0 1rem 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.status-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.status-value.success {
    color: #10b981;
}

.status-value.error {
    color: #ef4444;
}

.status-value.warning {
    color: #f59e0b;
}

/* ========== Status Bar (horizontal) ========== */
.status-bar {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.status-bar .status-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.status-bar .status-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.status-bar .status-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* ========== API Test Cards ========== */
.api-tests,
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.test-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.test-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.test-card-header,
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.test-card-header h3,
.test-header h3 {
    margin: 0;
    font-size: 1.125rem;
    color: var(--text-primary);
}

.test-desc,
.test-card-body p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.5rem 0 1rem 0;
}

/* ========== Test Buttons ========== */
.test-btn,
.btn-test {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    width: 100%;
    margin-top: 0.5rem;
}

.test-btn:hover,
.btn-test:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.test-btn:active,
.btn-test:active {
    transform: translateY(0);
}

/* ========== Test Results ========== */
.test-result {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.813rem;
    color: var(--text-primary);
    max-height: 300px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.test-result:empty {
    display: none;
}

.test-result.success {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.test-result.error {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ========== Console Section ========== */
.console-section {
    margin-top: 2rem;
}

.console-section h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.console-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.console-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

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

.console-output {
    background: #1a1a1a;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 0.813rem;
    padding: 1rem;
    border-radius: 8px;
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

.console-output .log-entry {
    margin-bottom: 0.25rem;
}

.console-output .log-entry.error {
    color: #ff4444;
}

.console-output .log-entry.warning {
    color: #ffaa00;
}

.console-output .log-entry.success {
    color: #00ff00;
}

.console-output .log-timestamp {
    color: #888;
    margin-right: 0.5rem;
}

/* ========== Debug Output ========== */
.debug-output {
    font-family: 'Courier New', monospace;
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    font-size: 0.813rem;
}

/* ========== JSON Viewer ========== */
.json-viewer {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.813rem;
}

.json-viewer .json-key {
    color: #e06c75;
}

.json-viewer .json-value {
    color: #98c379;
}

.json-viewer .json-string {
    color: #e5c07b;
}

.json-viewer .json-number {
    color: #d19a66;
}

.json-viewer .json-boolean {
    color: #56b6c2;
}

.json-viewer .json-null {
    color: #c678dd;
}

/* ========== Loading States ========== */
.loading-spinner-inline {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}

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

/* ========== Badges ========== */
.badge-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-status.online {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-status.offline {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-status.pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .api-tests,
    .test-grid {
        grid-template-columns: 1fr;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .console-controls {
        flex-direction: column;
    }
    
    .console-btn {
        width: 100%;
    }
}

/* ========== Dark Mode Specific ========== */
[data-theme="dark"] .console-output {
    background: #0d1117;
    border-color: #30363d;
}

[data-theme="dark"] .test-result {
    background: #0d1117;
}

[data-theme="dark"] .debug-output,
[data-theme="dark"] .json-viewer {
    background: #0d1117;
}

