/**
 * mFLIP Diagnostics Screen Styles
 * Debug UI for development and troubleshooting
 */

.diagnostics-screen {
    background: #0a0a0a;
    color: #e0e0e0;
    font-family: 'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace;
    font-size: 12px;
}

.diagnostics-screen .screen-header {
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.diagnostics-screen .screen-header h1 {
    font-size: 16px;
    font-weight: 600;
}

.diagnostics-content {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    overflow: hidden;
}

/* Status Banner */
.diag-status-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
}

.diag-status-banner.debug-on {
    background: #1a3a1a;
    border-color: #2a5a2a;
}

#diag-status-text {
    font-weight: 600;
    color: #888;
}

.diag-status-banner.debug-on #diag-status-text {
    color: #4caf50;
}

.diag-session-id {
    font-size: 10px;
    color: #666;
}

/* Tabs */
.diag-tabs {
    display: flex;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    overflow-x: auto;
    flex-shrink: 0;
}

.diag-tab {
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: #888;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.diag-tab:hover {
    color: #e0e0e0;
    background: #252525;
}

.diag-tab.active {
    color: #4caf50;
    border-bottom-color: #4caf50;
}

/* Filters */
.diag-filters {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: #151515;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}

.diag-filter-select,
.diag-search {
    padding: 6px 10px;
    background: #252525;
    border: 1px solid #333;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 12px;
}

.diag-search {
    flex: 1;
    min-width: 100px;
}

.diag-autoscroll {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #888;
    font-size: 11px;
    white-space: nowrap;
}

.diag-autoscroll input {
    margin: 0;
}

/* Tab Content */
.diag-tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
    flex-direction: column;
}

.diag-tab-content.active {
    display: flex;
}

/* Log List */
.diag-log-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    background: #0a0a0a;
}

.diag-log-entry {
    display: flex;
    padding: 4px 8px;
    border-radius: 3px;
    margin-bottom: 2px;
    font-size: 11px;
    line-height: 1.4;
}

.diag-log-entry:hover {
    background: #1a1a1a;
}

.diag-log-entry.level-DEBUG {
    color: #888;
}

.diag-log-entry.level-INFO {
    color: #64b5f6;
}

.diag-log-entry.level-WARN {
    color: #ffb74d;
    background: rgba(255, 183, 77, 0.1);
}

.diag-log-entry.level-ERROR {
    color: #ef5350;
    background: rgba(239, 83, 80, 0.1);
}

.diag-log-time {
    color: #666;
    margin-right: 8px;
    flex-shrink: 0;
    font-size: 10px;
}

.diag-log-level {
    width: 50px;
    flex-shrink: 0;
    font-weight: 600;
}

.diag-log-tag {
    color: #9c27b0;
    margin-right: 8px;
    flex-shrink: 0;
    min-width: 60px;
}

.diag-log-msg {
    flex: 1;
    word-break: break-word;
}

.diag-log-data {
    margin-left: 8px;
    color: #666;
    font-size: 10px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Info Grid */
.diag-info-grid {
    display: grid;
    gap: 4px;
    padding: 8px;
    background: #151515;
    border-radius: 6px;
    margin-bottom: 12px;
}

.diag-info-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #222;
}

.diag-info-row:last-child {
    border-bottom: none;
}

.diag-info-label {
    color: #888;
}

.diag-info-value {
    color: #e0e0e0;
    font-weight: 500;
}

/* WebSocket Status */
.diag-ws-status {
    padding: 12px;
}

.diag-ws-status h3 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #888;
}

/* Test Results */
.diag-test-controls {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid #333;
}

.diag-test-results {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.diag-test-hint {
    color: #666;
    text-align: center;
    padding: 40px 20px;
}

.diag-test-item {
    display: flex;
    align-items: flex-start;
    padding: 8px;
    margin-bottom: 8px;
    background: #151515;
    border-radius: 6px;
    border-left: 3px solid #333;
}

.diag-test-item.pass {
    border-left-color: #4caf50;
}

.diag-test-item.fail {
    border-left-color: #ef5350;
}

.diag-test-item.running {
    border-left-color: #ffb74d;
}

.diag-test-icon {
    width: 24px;
    text-align: center;
    margin-right: 8px;
    font-size: 14px;
}

.diag-test-item.pass .diag-test-icon {
    color: #4caf50;
}

.diag-test-item.fail .diag-test-icon {
    color: #ef5350;
}

.diag-test-item.running .diag-test-icon {
    color: #ffb74d;
}

.diag-test-info {
    flex: 1;
}

.diag-test-name {
    font-weight: 600;
    margin-bottom: 4px;
}

.diag-test-detail {
    font-size: 10px;
    color: #888;
}

.diag-test-error {
    margin-top: 4px;
    padding: 6px;
    background: rgba(239, 83, 80, 0.1);
    border-radius: 4px;
    color: #ef5350;
    font-size: 10px;
}

/* Export Section */
.diag-export-section {
    padding: 12px;
    border-bottom: 1px solid #222;
}

.diag-export-section h3 {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: #888;
}

.diag-export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Buttons */
.diag-btn,
.diag-btn-small,
.diag-btn-primary,
.diag-btn-danger {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.diag-btn {
    background: #333;
    color: #e0e0e0;
}

.diag-btn:hover {
    background: #444;
}

.diag-btn-small {
    padding: 6px 12px;
    font-size: 11px;
    background: #333;
    color: #e0e0e0;
}

.diag-btn-primary {
    background: #4caf50;
    color: white;
}

.diag-btn-primary:hover {
    background: #45a049;
}

.diag-btn-danger {
    background: #c62828;
    color: white;
}

.diag-btn-danger:hover {
    background: #b71c1c;
}

.diag-btn:disabled,
.diag-btn-small:disabled,
.diag-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Error controls */
.diag-error-controls {
    padding: 8px 12px;
    border-bottom: 1px solid #333;
}

/* Scrollbar styling */
.diag-log-list::-webkit-scrollbar,
.diag-test-results::-webkit-scrollbar {
    width: 8px;
}

.diag-log-list::-webkit-scrollbar-track,
.diag-test-results::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.diag-log-list::-webkit-scrollbar-thumb,
.diag-test-results::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

.diag-log-list::-webkit-scrollbar-thumb:hover,
.diag-test-results::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* Toast for copy success */
.diag-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: #333;
    color: #e0e0e0;
    border-radius: 8px;
    font-size: 12px;
    z-index: 10000;
    animation: diagToastIn 0.3s ease;
}

@keyframes diagToastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
