* {
    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;
    padding: 20px;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

header h1 {
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    color: #666;
    font-size: 1.1em;
}

.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #218838;
}

.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    display: none;
}

.timeout-input {
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeout-input label {
    font-weight: 600;
    color: #495057;
}

.timeout-input input {
    padding: 8px 12px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1em;
    width: 100px;
}

.status, .results {
    margin-top: 30px;
    padding: 25px;
    border-radius: 8px;
    background: #f8f9fa;
}

.status h3, .results h3 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.status-info p {
    margin: 10px 0;
    font-size: 1.1em;
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.9em;
}

.badge.queued {
    background: #ffc107;
    color: #000;
}

.badge.running {
    background: #17a2b8;
    color: white;
}

.badge.completed {
    background: #28a745;
    color: white;
}

.badge.failed {
    background: #dc3545;
    color: white;
}

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

.metric {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.metric label {
    display: block;
    color: #666;
    font-size: 0.9em;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric .value {
    display: block;
    color: #667eea;
    font-size: 1.8em;
    font-weight: 700;
}

.svg-container {
    margin: 30px 0;
}

.svg-container h4 {
    color: #495057;
    margin-bottom: 15px;
    font-size: 1.2em;
}

#svgDisplay {
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    overflow: auto;
    max-height: 600px;
}

#svgDisplay svg {
    max-width: 100%;
    height: auto;
}

.downloads {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #f5c6cb;
    margin-top: 20px;
}

.hidden {
    display: none;
}

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

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s linear infinite;
}
