/* Reset and base styles */
* {
    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: #1f2937;
    background: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

/* Header */
header {
    background: #ffffff;
    color: #1f2937;
    padding: 32px 40px;
    border-bottom: 1px solid #e5e7eb;
}

header h1 {
    font-size: 1.875rem;
    margin-bottom: 4px;
    font-weight: 600;
    color: #111827;
}

header p {
    font-size: 0.975rem;
    color: #6b7280;
}

/* Main content */
main {
    padding: 40px;
}

section {
    margin-bottom: 40px;
}

h2 {
    color: #1f2937;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Upload section */
.upload-form {
    background: #f8fafc;
    padding: 30px;
    border-radius: 8px;
    border: 2px dashed #e2e8f0;
}

.file-drop-area {
    border: 2px dashed #cbd5e1;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    margin-bottom: 25px;
    background: white;
}

.file-drop-area:hover {
    border-color: #6b7280;
    background: #f8fafc;
}

.file-drop-area.dragover {
    border-color: #374151;
    background: #f3f4f6;
}

.file-icon {
    width: 32px !important;
    height: 32px !important;
    max-width: 32px;
    max-height: 32px;
    margin: 0 auto 16px;
    color: #9ca3af;
    stroke-width: 1.5;
    flex-shrink: 0;
}

.file-drop-content p {
    font-size: 0.95rem;
    color: #64748b;
}

.file-drop-content small {
    font-size: 0.85rem;
    color: #9ca3af;
}

.browse-link {
    color: #374151;
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

.browse-link:hover {
    color: #111827;
}

.file-selected {
    background: #ecfdf5 !important;
    border-color: #22c55e !important;
}

.file-selected .file-icon {
    color: #10b981;
}

.file-selected p {
    color: #166534 !important;
    font-weight: 500;
}

/* Form styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 500;
    margin-bottom: 8px;
    color: #374151;
}

input, select {
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

input:focus, select:focus {
    outline: none;
    border-color: #374151;
    box-shadow: 0 0 0 3px rgba(55, 65, 81, 0.1);
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #1f2937;
    color: white;
    width: 100%;
    justify-content: center;
    margin-top: 10px;
}

.btn-primary:hover {
    background: #111827;
}

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

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

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

.btn-spinner {
    animation: spin 1s linear infinite;
}

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

/* Jobs section */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.jobs-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.no-jobs {
    text-align: center;
    color: #6b7280;
    padding: 40px;
    font-style: italic;
}

.job-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: all 0.2s ease;
}

.job-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.job-title {
    font-weight: 600;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 8px;
}

.job-meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: #6b7280;
}

.job-meta span {
    display: flex;
    flex-direction: column;
}

.job-meta strong {
    color: #374151;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: #374151;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.job-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-download {
    background: #10b981;
    color: white;
}

.btn-download:hover {
    background: #059669;
}

.btn-delete {
    background: #ef4444;
    color: white;
}

.btn-delete:hover {
    background: #dc2626;
}

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-processing {
    background: #e5e7eb;
    color: #374151;
}

.status-completed {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 8px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 2rem;
    }

    main {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .job-meta {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .job-actions {
        flex-direction: column;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.job-card {
    animation: fadeIn 0.3s ease;
}

/* Error states */
.error {
    border-color: #ef4444 !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 4px;
}