/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, 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 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    color: white;
    flex-wrap: wrap;
    gap: 20px;
}

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

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

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1rem;
}

.user-info span {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

/* Card */
.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    padding: 30px;
    margin-bottom: 30px;
    transition: transform 0.3s ease;
}

.card:hover {
    /* transform: translateY(-5px); */
}

.card h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #cbd5e0;
    border-radius: 10px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background: #f7fafc;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #667eea;
    background: #ebf4ff;
    transform: scale(1.02);
}

.upload-content i {
    font-size: 4rem;
    color: #a0aec0;
    margin-bottom: 20px;
    display: block;
}

.upload-content p {
    font-size: 1.2rem;
    color: #718096;
}

.browse-text {
    color: #667eea;
    text-decoration: underline;
    cursor: pointer;
}

/* Selected File */
.selected-file {
    background: #f0fff4;
    border: 2px solid #68d391;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-info i {
    font-size: 2rem;
    color: #38a169;
}

.file-name {
    font-weight: bold;
    color: #2d3748;
}

.file-size {
    color: #718096;
    font-size: 0.8rem;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

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

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

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

.btn-icon {
    padding: 8px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
}

.btn-icon:hover {
    background: #edf2f7;
}

/* Jobs Container */
.jobs-container {
    max-height: 600px;
    overflow-y: auto;
}

.no-jobs {
    text-align: center;
    color: #a0aec0;
    padding: 40px;
}

.no-jobs i {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
}

/* Modern Job Item Design */
.job-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    position: relative;
    overflow: hidden;
}

.job-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #e5e7eb;
    transition: background 0.3s ease;
}

.job-item.processing::before { background: #3b82f6; }
.job-item.completed::before { background: #10b981; }
.job-item.failed::before { background: #ef4444; }
.job-item.cancelled::before { background: #6b7280; }
.job-item.pending::before { background: #f59e0b; }

.job-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.m3u8link {
    color: #3b82f6;
    font-size: 0.875rem;
    /* text-decoration: underline; */
    /* cursor: pointer; */
}

/* Modern Job Header */
.job-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    gap: 16px;
}

.job-info {
    flex: 1;
    min-width: 0;
}

.job-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.job-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
    flex-wrap: wrap;
    align-items: center;
}

.job-meta > span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.job-id {
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.job-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modern Status Badge */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: capitalize;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid;
    white-space: nowrap;
}

.status-pending { 
    background: #fef3c7; 
    color: #d97706; 
    border-color: #f3c973;
}
.status-processing { 
    background: #dbeafe; 
    color: #1d4ed8;
    border-color: #93c5fd;
}
.status-completed { 
    background: #d1fae5; 
    color: #059669;
    border-color: #6ee7b7;
}
.status-failed { 
    background: #fee2e2; 
    color: #dc2626;
    border-color: #fca5a5;
}
.status-cancelled { 
    background: #f1f5f9; 
    color: #64748b;
    border-color: #cbd5e1;
}

/* Job Progress */
.job-progress {
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.job-progress .progress-bar {
    flex: 1;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.job-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.job-progress .progress-text {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    min-width: 35px;
}

/* Current Step Message */
.current-step-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin: 12px 0;
    font-size: 13px;
    color: #0369a1;
    font-weight: 500;
}

.current-step-message i {
    color: #3b82f6;
    font-size: 1rem;
}

.step-message {
    font-weight: 500;
}

/* Job Steps - Compact Version */
.job-steps {
    margin: 12px 0;
    padding: 8px 0;
    border-top: 1px solid #e5e7eb;
}

.job-steps h4 {
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    padding: 4px 8px;
    background: #f8fafc;
    border-radius: 6px;
}

.step-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.step-icon.pending { color: #d97706; }
.step-icon.running { color: #3b82f6; }
.step-icon.completed { color: #059669; }
.step-icon.failed { color: #dc2626; }

.step-name {
    font-weight: 500;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Job Result Link */
.job-result {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.m3u8link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}

.m3u8link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Compact Steps */
.job-steps-compact {
    margin-top: 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.step-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid;
}

.step-badge.pending {
    background: #fef3c7;
    color: #d97706;
    border-color: #f3c973;
}

.step-badge.running {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.step-badge.completed {
    background: #d1fae5;
    color: #059669;
    border-color: #6ee7b7;
}

.step-badge.failed {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Modern Job Actions */
.job-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.job-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    color: #374151;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    border: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.job-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.job-btn.primary {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.job-btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.job-btn.success {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.job-btn.success:hover {
    background: #059669;
    border-color: #059669;
}

.job-btn.danger {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
}

.job-btn.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.job-btn.secondary {
    background: #f3f4f6;
    color: #6b7280;
    border-color: #d1d5db;
}

.job-btn.secondary:hover {
    background: #e5e7eb;
    color: #374151;
    align-items: center;
    gap: 4px;
    text-decoration: none;
}

.job-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

.job-btn.primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.job-btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.job-btn.success {
    background: #059669;
    border-color: #059669;
    color: #ffffff;
}

.job-btn.success:hover {
    background: #047857;
    border-color: #047857;
}

/* Error Display */
.job-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 12px;
    margin-top: 12px;
    font-size: 13px;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Upload Tabs */
.upload-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.tab-btn {
    flex: 1;
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.tab-btn.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

.tab-btn:hover {
    color: #3b82f6;
    background: #f8fafc;
}

/* Batch Upload */
.selected-files {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.batch-info {
    margin-bottom: 20px;
}

.batch-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 12px;
    transition: border-color 0.3s ease;
}

.batch-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.batch-input[type="textarea"] {
    height: 80px;
    resize: vertical;
}

.files-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 8px;
}

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

.file-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.file-item-info i {
    color: #3b82f6;
    font-size: 20px;
}

.file-item-details {
    display: flex;
    flex-direction: column;
}

.file-item-name {
    font-weight: 600;
    color: #1f2937;
}

.file-item-size {
    font-size: 14px;
    color: #6b7280;
}

.file-item-remove {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-item-remove:hover {
    background: #fecaca;
}

/* Batch Processing */
.batch-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.batch-item:hover {
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.batch-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.batch-info-display h3 {
    margin: 0 0 8px 0;
    color: #1f2937;
    font-size: 18px;
}

.batch-info-display p {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
}

.batch-stats {
    display: flex;
    gap: 16px;
    margin: 12px 0;
}

.batch-stat {
    text-align: center;
}

.batch-stat-number {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
}

.batch-stat-label {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
}

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

.batch-jobs {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.batch-jobs-title {
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.batch-job-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f9fafb;
    border-radius: 6px;
    margin-bottom: 8px;
}

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

.batch-job-name {
    font-weight: 500;
    color: #374151;
}

.batch-job-status {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.job-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.step-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 3px solid #e2e8f0;
}

.step-item.running { border-left-color: #f6ad55; }
.step-item.completed { border-left-color: #68d391; }
.step-item.failed { border-left-color: #fc8181; }

.step-name {
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 5px;
}

.step-progress {
    font-size: 0.9rem;
    color: #718096;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.setting-item input,
.setting-item select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.setting-item input:focus,
.setting-item select:focus {
    outline: none;
    border-color: #667eea;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(2px);
}

.modal.show {
    display: flex !important;
}

.modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    position: relative;
    margin: auto;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

/* Modal Animation */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalFadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

.modal.show .modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

/* Close modal when clicking outside */
.modal {
    cursor: pointer;
}

.modal-content {
    cursor: default;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

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

.progress-text {
    text-align: center;
    font-weight: bold;
    color: #4a5568;
}

/* Steps Container */
.steps-container {
    margin-bottom: 30px;
}

.modal-step {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f7fafc;
    border-radius: 8px;
}

.modal-step i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.modal-step.pending i { color: #a0aec0; }
.modal-step.running i { color: #f6ad55; }
.modal-step.completed i { color: #68d391; }
.modal-step.failed i { color: #fc8181; }

/* Result Container */
.result-container {
    margin-bottom: 30px;
}

.result-item {
    margin-bottom: 20px;
}

.result-item label {
    display: block;
    font-weight: bold;
    color: #4a5568;
    margin-bottom: 8px;
}

.url-container {
    display: flex;
    gap: 10px;
}

.url-container input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

/* Modal Actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

/* Notification */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    z-index: 1001;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notification.success .notification-icon { color: #38a169; }
.notification.error .notification-icon { color: #e53e3e; }
.notification.info .notification-icon { color: #3182ce; }

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .selected-file {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .job-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .modal-content {
        margin: 20px;
        width: calc(100% - 40px);
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .url-container {
        flex-direction: column;
    }
}

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

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

/* System Status */
.system-status {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

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

.status-item {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #667eea;
}

.status-label {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 5px;
}

.status-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2d3748;
}

.memory-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

.memory-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: #4a5568;
}

.memory-item span:last-child {
    font-weight: bold;
    color: #2d3748;
}

/* Custom Scrollbar */
.jobs-container::-webkit-scrollbar {
    width: 8px;
}

.jobs-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.jobs-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.jobs-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* Job Statistics */
.job-stats {
    margin-bottom: 20px;
}

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

.stat-item {
    background: #4a5568;
    color: white;
    padding: 8px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Job Filters */
.job-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 10px;
}

.filter-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #4a5568;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: #667eea;
    background: #edf2f7;
}

.filter-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.filter-btn i {
    font-size: 0.8rem;
}

/* Resume Button */
.job-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.resume-btn {
    padding: 8px 16px;
    background: #38a169;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.resume-btn:hover {
    background: #2f855a;
}

.resume-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

/* Job Step Progress */
.job-steps {
    margin-top: 15px;
    padding: 15px;
    background: #f8fafc;
    border-radius: 8px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.step-item:last-child {
    border-bottom: none;
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.step-icon.pending {
    background: #e2e8f0;
    color: #718096;
}

.step-icon.running {
    background: #fbb6ce;
    color: #d53f8c;
}

.step-icon.completed {
    background: #9ae6b4;
    color: #38a169;
}

.step-icon.failed {
    background: #fed7d7;
    color: #e53e3e;
}

.step-name {
    flex: 1;
    font-size: 0.9rem;
    color: #4a5568;
}

.step-progress {
    font-size: 0.8rem;
    color: #718096;
}

/* Responsive Design */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .job-filters {
        flex-direction: column;
    }
    
    .filter-btn {
        justify-content: center;
    }
    
    .job-actions {
        flex-direction: column;
    }
}

/* Token Management Styles */
.token-section {
    margin-top: 2rem;
}

.token-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 0.875rem;
    /* color: #64748b; */
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    /* color: #1e293b; */
}

.token-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.token-list {
    min-height: 200px;
}

.no-tokens {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: #64748b;
}

.no-tokens i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.token-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.token-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.token-item.inactive {
    opacity: 0.6;
    background: #f8fafc;
}

.token-info {
    flex: 1;
}

.token-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.25rem;
}

.token-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #64748b;
}

.token-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.token-status.active {
    background: #dcfce7;
    color: #166534;
}

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

.token-actions-inline {
    display: flex;
    gap: 0.5rem;
}

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

.btn-token.test {
    background: #dbeafe;
    color: #1d4ed8;
}

.btn-token.test:hover {
    background: #bfdbfe;
}

.btn-token.toggle {
    background: #fef3c7;
    color: #92400e;
}

.btn-token.toggle:hover {
    background: #fde68a;
}

.btn-token.edit {
    background: #e0f2fe;
    color: #0369a1;
}

.btn-token.edit:hover {
    background: #bae6fd;
}

.btn-token.delete {
    background: #fee2e2;
    color: #dc2626;
}

.btn-token.delete:hover {
    background: #fecaca;
}

/* Token Modal */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.25rem;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f3f4f6;
    color: #374151;
}

.modal-close:active {
    background: #e5e7eb;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #374151;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input[readonly] {
    background-color: #f9fafb;
    color: #6b7280;
    cursor: not-allowed;
}

.form-group input[readonly]:focus {
    border-color: #d1d5db;
    box-shadow: none;
}

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

@media (max-width: 768px) {
    .token-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .token-actions {
        flex-direction: column;
    }
    
    .token-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .token-actions-inline {
        align-self: stretch;
        justify-content: space-between;
    }
}

/* Upload Progress Styles */
.upload-progress-section {
    margin-top: 2rem;
}

.upload-stats {
    margin-bottom: 1.5rem;
}

.upload-list {
    min-height: 200px;
}

.no-uploads {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: #64748b;
}

.no-uploads i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.upload-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.upload-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.upload-item.status-completed {
    border-color: #10b981;
    background: #f0fdf4;
}

.upload-item.status-failed {
    border-color: #ef4444;
    background: #fef2f2;
}

.upload-item.status-uploading {
    border-color: #3b82f6;
    background: #eff6ff;
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.upload-info h4 {
    margin: 0 0 0.5rem 0;
    color: #1e293b;
    font-size: 1.1rem;
}

.upload-meta {
    margin: 0;
    color: #64748b;
    font-size: 0.875rem;
}

.current-file {
    font-weight: 500;
    color: #1e293b;
}

.upload-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.status-uploading {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-badge.status-completed {
    background: #dcfce7;
    color: #166534;
}

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

.status-badge.status-cancelled {
    background: #f3f4f6;
    color: #374151;
}

.upload-progress {
    margin-bottom: 1rem;
}

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.upload-item.status-completed .progress-fill {
    background: linear-gradient(90deg, #10b981, #059669);
}

.upload-item.status-failed .progress-fill {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #64748b;
}

.progress-percentage {
    font-weight: 600;
    color: #1e293b;
}

.upload-errors {
    padding: 0.75rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    margin-top: 0.75rem;
}

.error-count {
    color: #991b1b;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Upload Details Modal */
.upload-details-modal {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
}

.upload-summary {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.summary-stats {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stat-item i {
    color: #3b82f6;
}

.stat-item strong {
    /* color: #1e293b; */
}

.upload-files-list h4 {
    margin-bottom: 1rem;
    color: #1e293b;
    font-size: 1.1rem;
}

.files-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.upload-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.2s ease;
}

.upload-file-item:last-child {
    border-bottom: none;
}

.upload-file-item:hover {
    background-color: #f8fafc;
}

.file-info {
    flex: 1;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #1e293b;
}

.file-name i {
    color: #64748b;
}

.file-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #64748b;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.upload-status {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.upload-status.success {
    background: #dcfce7;
    color: #166534;
}

.btn-link, .btn-copy {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.btn-link:hover, .btn-copy:hover {
    background: #eff6ff;
    color: #1d4ed8;
}

.job-btn.secondary {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

.job-btn.secondary:hover {
    background: #e2e8f0;
    color: #334155;
}

.job-btn.resume-btn {
    background: linear-gradient(135deg, #10b981, #047857);
    color: white;
    border: none;
}

.job-btn.resume-btn:hover {
    background: linear-gradient(135deg, #059669, #065f46);
    transform: translateY(-1px);
}

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

@media (max-width: 768px) {
    .upload-header {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .upload-status {
        align-self: stretch;
        justify-content: space-between;
    }

    .upload-details-modal {
        max-width: 95%;
        margin: 1rem;
    }

    .summary-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .upload-file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .file-actions {
        align-self: stretch;
        justify-content: space-between;
    }
}

/* Upload Status Styles */
.upload-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.upload-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upload-status.failed {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.upload-status.uploading {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.upload-status.pending {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Re-upload Button */
.btn-reupload {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-reupload:hover {
    background: linear-gradient(135deg, #ff5252, #e84118);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.btn-reupload:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* File Error Display */
.file-error {
    color: #dc3545;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.file-error i {
    font-size: 0.7rem;
}

/* Statistics with failed files */
.stat-item i.fa-times-circle {
    color: #dc3545;
}

.stat-item i.fa-check-circle {
    color: #28a745;
}