/* Test Tool Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.test-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    min-height: 100vh;
}

/* Header */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.test-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.back-link {
    color: #007AFF;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    background: white;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 0.875rem 1.5rem;
    border: none;
    background: #f0f0f0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e8e8e8;
}

.tab-btn.active {
    background: white;
    color: #007AFF;
    border-bottom: 3px solid #007AFF;
}

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    min-height: 500px;
}

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

/* Toolbar */
.toolbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.toolbar label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #555;
}

.toolbar input[type="number"] {
    width: 80px;
    padding: 0.5rem 0.625rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.875rem;
}

.toolbar input[type="file"] {
    font-size: 0.875rem;
}

/* Buttons */
.btn {
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.btn-primary {
    background: #007AFF;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
}

.btn-primary:disabled {
    background: #99c4f7;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-secondary:disabled {
    color: #999;
    cursor: not-allowed;
}

/* Progress */
.progress-section {
    margin-bottom: 1.25rem;
    display: none;
}

.progress-section.visible {
    display: block;
}

.progress-bar-container {
    background: #e9ecef;
    border-radius: 8px;
    height: 24px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 100%;
    background: #007AFF;
    border-radius: 8px;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 40px;
}

.progress-info {
    font-size: 0.8rem;
    color: #666;
}

/* Status Badge */
.status {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-idle { background: #e9ecef; color: #666; }
.status-running { background: #fff3cd; color: #856404; }
.status-done { background: #d4edda; color: #155724; }
.status-error { background: #f8d7da; color: #721c24; }

/* Prompt Section */
.prompt-section {
    margin-bottom: 1.25rem;
}

.prompt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.375rem;
}

.prompt-header label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #555;
}

.btn-sm {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
}

.prompt-section textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    resize: vertical;
    color: #333;
    background: #fafafa;
}

.prompt-section textarea:focus {
    outline: none;
    border-color: #007AFF;
    background: #fff;
}

.prompt-hint {
    margin-top: 0.375rem;
    font-size: 0.75rem;
    color: #999;
}

.prompt-hint code {
    background: #f0f0f0;
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    font-size: 0.75rem;
}

/* Tables */
.table-wrapper {
    overflow-x: auto;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 0.625rem 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

tr:hover td {
    background: #f8f9fa;
}

td.truncate {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td.wrap {
    max-width: 400px;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-size: 0.9rem;
}

/* Loading spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #007AFF;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Timestamp */
.timestamp {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.75rem;
}

/* Responsive */
@media (max-width: 768px) {
    .test-container {
        padding: 1rem;
    }

    .tabs {
        flex-direction: column;
    }

    .tab-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
    }

    .tab-btn.active {
        border-left: 3px solid #007AFF;
        border-bottom: none;
    }

    .toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
