* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.header,
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 40px;
    text-align: center;
}

.header h1,
header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

.header p,
header p {
    opacity: 0.9;
}

.subtitle {
    opacity: 0.9;
    font-size: 1.1em;
}

.content,
main {
    padding: 40px;
}

footer {
    text-align: center;
    padding: 20px 40px;
    color: #888;
    font-size: 0.9em;
    border-top: 1px solid #eee;
}

.results-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.status-box {
    padding: 20px 25px;
    border-radius: 8px;
    border-left: 5px solid;
}

.status-box h2 {
    font-size: 1.3em;
    margin-bottom: 8px;
}

.status-box code {
    background: rgba(0,0,0,0.08);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.status-completed {
    background: #e8f5e9;
    border-color: #28a745;
    color: #1a5c2a;
}

.status-failed {
    background: #fff5f5;
    border-color: #dc3545;
    color: #721c24;
}

.results-gallery {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.results-gallery h3 {
    font-size: 1.3em;
    color: #667eea;
    margin-bottom: 5px;
}

.result-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.result-item h4 {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 12px;
}

.image-container {
    background: white;
    border-radius: 6px;
    padding: 10px;
    border: 1px solid #dee2e6;
    margin-bottom: 12px;
}

.result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-small {
    padding: 8px 18px;
    font-size: 0.9em;
    width: auto;
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

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

.log-section {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.log-summary {
    padding: 14px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #555;
    list-style: none;
    user-select: none;
}

.log-summary:hover {
    background: #e9ecef;
}

.log-content {
    padding: 0 20px 20px;
}

.log-content pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 0.85em;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.actions {
    display: flex;
    justify-content: center;
}

.actions .btn {
    max-width: 300px;
}

.info-box {
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.info-box h2 {
    color: #667eea;
    font-size: 1.3em;
    margin-bottom: 15px;
}

.info-box ul {
    margin-left: 20px;
}

.info-box ul li {
    margin: 8px 0;
}

.info-box code {
    background: #d1e7ff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.upload-area {
    border: 3px dashed #667eea;
    border-radius: 12px;
    padding: 50px 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f8f9fa;
    position: relative;
    margin-bottom: 25px;
}

.upload-area:hover {
    border-color: #764ba2;
    background: #f0f1f3;
}

.upload-area.drag-over {
    border-color: #28a745;
    background: #e8f5e9;
}

.upload-icon {
    font-size: 3.5em;
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 10px;
}

.upload-area input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

.file-list {
    margin: 20px 0;
}

.file-list h4 {
    margin-bottom: 10px;
    color: #333;
}

.file-list ul {
    list-style: none;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 15px;
}

.file-list ul li {
    padding: 8px;
    margin: 5px 0;
    background: white;
    border-radius: 4px;
    border-left: 3px solid #667eea;
}

.file-list ul li.invalid {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.file-list .error {
    color: #dc3545;
    font-weight: 600;
}

.btn {
    display: inline-block;
    padding: 14px 35px;
    border: none;
    border-radius: 6px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    text-align: center;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

.progress-section {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
}

.progress-section h3 {
    margin-bottom: 20px;
    color: #667eea;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e9ecef;
    border-radius: 15px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
    width: 0%;
}

.spinner {
    margin: 20px auto;
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@media (max-width: 768px) {
    .content {
        padding: 20px;
    }

    .upload-area {
        padding: 30px 20px;
    }

    .header h1 {
        font-size: 1.5em;
    }
}