/* ComfyUI API Tester Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.status-panel {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.status-label {
    font-weight: 600;
}

.status-value {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-value.healthy {
    background: #22c55e;
    color: white;
}

.status-value.unhealthy {
    background: #ef4444;
    color: white;
}

.status-value.checking {
    background: #f59e0b;
    color: white;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.input-section, .output-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.input-section h2, .output-section h2 {
    color: #4f46e5;
    margin-bottom: 20px;
    font-size: 1.4rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.image-input-methods {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-method {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.input-method:has(input[type="radio"]:checked) {
    border-color: #4f46e5;
    background: #f8faff;
}

.input-method input[type="radio"] {
    margin: 0;
}

.input-method label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    min-width: 100px;
}

.file-input {
    flex: 1;
}

.input-method input[type="text"] {
    flex: 1;
    margin: 0;
}

.image-preview-container {
    margin-top: 15px;
    padding: 15px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    text-align: center;
}

.image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.image-info {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #6b7280;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

.btn-primary {
    background: #4f46e5;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

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

#refreshWorkflows {
    padding: 8px 16px;
    font-size: 12px;
    margin-left: 10px;
}

.loading-indicator {
    text-align: center;
    padding: 40px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid #4f46e5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 3px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

.error-container {
    padding: 20px;
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 20px;
}

.error-container h3 {
    color: #dc2626;
    margin-bottom: 10px;
}

.error-message {
    color: #dc2626;
    font-weight: 500;
    margin-bottom: 10px;
}

.error-details {
    color: #7f1d1d;
    font-size: 0.9rem;
    font-family: 'Monaco', 'Consolas', monospace;
    background: rgba(185, 28, 28, 0.1);
    padding: 10px;
    border-radius: 4px;
    white-space: pre-wrap;
}

.success-container {
    padding: 20px;
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 20px;
}

.success-container h3 {
    color: #16a34a;
    margin-bottom: 10px;
}

.result-info {
    color: #15803d;
    font-weight: 500;
}

.generated-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.curl-container {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8faff;
    border: 2px solid #e0e7ff;
    border-radius: 8px;
}

.curl-container h3 {
    color: #3730a3;
    margin-bottom: 15px;
}

.curl-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.curl-command {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 6px;
    font-family: 'Monaco', 'Consolas', 'Ubuntu Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    border: 1px solid #334155;
    max-height: 400px;
    overflow-y: auto;
}

.curl-command::selection {
    background: #475569;
}

.curl-container .btn-secondary {
    font-size: 13px;
    padding: 8px 16px;
}

.generated-image {
    text-align: center;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
}

.generated-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 10px;
}

.generated-image .image-info {
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
    font-size: 12px;
    color: #374151;
}

.generated-image .image-dimensions {
    font-weight: 600;
    color: #1f2937;
    display: block;
    margin-bottom: 2px;
}

.generated-image .image-size {
    color: #6b7280;
    font-size: 11px;
}

/* Request Preview Styles */
.request-preview {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.preview-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px;
}

.preview-item:last-child {
    margin-bottom: 0;
}

.preview-label {
    font-weight: 600;
    color: #1e40af;
    min-width: 120px;
    font-size: 13px;
}

.preview-value {
    flex: 1;
    color: #374151;
    font-size: 12px;
    margin: 0 10px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-value.empty {
    color: #9ca3af;
    font-style: italic;
}

.preview-value.filled {
    color: #059669;
    font-weight: 500;
}

.status-indicator {
    font-size: 16px;
    min-width: 24px;
    text-align: center;
}

.status-indicator.required {
    color: #dc2626;
}

.status-indicator.optional {
    color: #f59e0b;
}

.status-indicator.included {
    color: #059669;
}

.status-indicator.empty {
    color: #9ca3af;
}

.generated-image .image-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.generated-image .btn-secondary {
    padding: 6px 12px;
    font-size: 12px;
    margin: 0;
}

.response-container {
    margin-top: 20px;
}

.response-container h3 {
    color: #374151;
    margin-bottom: 10px;
}

.json-response {
    background: #1f2937;
    color: #e5e7eb;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

footer {
    text-align: center;
    padding: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .status-panel {
        flex-direction: column;
        gap: 15px;
    }

    .input-section, .output-section {
        padding: 20px;
    }

    .image-input-methods {
        gap: 10px;
    }

    .input-method {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .generated-images {
        grid-template-columns: 1fr;
    }
}