:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --border-color: #bdc3c7;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    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: var(--dark-color);
    line-height: 1.6;
}

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

/* Header Styles */
.header {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.header h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 300;
}

.header p {
    color: #7f8c8d;
    font-size: 1.1em;
}

/* Card Styles */
.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.card-header {
    background: var(--primary-color);
    color: white;
    padding: 20px;
}

.card-header h2 {
    font-size: 1.5em;
    font-weight: 400;
}

.card-body {
    padding: 30px;
}

/* Form Styles */
.input-section {
    margin-bottom: 30px;
}

.input-section h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.2em;
    font-weight: 500;
}

.url-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.url-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.url-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* File Upload Styles */
.file-upload {
    position: relative;
    margin-bottom: 20px;
}

.file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 3px dashed var(--border-color);
    border-radius: var(--border-radius);
    background: #f8f9fa;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.file-label:hover,
.file-label.dragover {
    border-color: var(--primary-color);
    background: rgba(52, 152, 219, 0.05);
}

.file-label i {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.file-label span {
    color: #7f8c8d;
    font-size: 16px;
}

.uploaded-files-list {
    margin-top: 20px;
}

.uploaded-files-list h4 {
    color: var(--secondary-color);
    margin-bottom: 15px;
    font-size: 1.1em;
    font-weight: 500;
}

.files-list {
    margin-top: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-color);
    position: relative;
}

.file-item.queued {
    border-left-color: #6c757d;
    background: #f1f3f4;
}

.file-item.uploading {
    border-left-color: var(--warning-color);
}

.file-item.uploaded {
    border-left-color: var(--success-color);
}

.file-item.error {
    border-left-color: var(--danger-color);
}

.file-order {
    display: flex;
    align-items: center;
    font-weight: bold;
    color: var(--primary-color);
    margin-right: 15px;
    min-width: 30px;
}

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

.file-info i {
    color: var(--primary-color);
}

.file-size {
    color: #7f8c8d;
    font-size: 0.9em;
}

.file-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-upload-progress {
    width: 100%;
    height: 4px;
    background: #ecf0f1;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.file-upload-progress-bar {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.file-upload-progress.error .file-upload-progress-bar {
    background: var(--danger-color);
}

.file-upload-progress.success .file-upload-progress-bar {
    background: var(--success-color);
}

.upload-status {
    font-size: 0.8em;
    margin-top: 5px;
    color: #7f8c8d;
}

.move-btn {
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    font-size: 12px;
    min-width: auto;
    border-radius: 4px;
}

.file-list {
    margin-top: 15px;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
    text-align: center;
    justify-content: center;
    min-width: 120px;
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-remove {
    background: var(--danger-color);
    color: white;
    padding: 8px 12px;
    min-width: auto;
}

.btn-copy {
    background: #34495e;
    color: white;
    padding: 6px 10px;
    font-size: 12px;
    min-width: auto;
}

/* Divider */
.divider {
    text-align: center;
    margin: 30px 0;
    position: relative;
    color: #7f8c8d;
    font-weight: 500;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
    z-index: 1;
}

.divider::after {
    content: 'OR';
    background: white;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Status Styles */
.status-info {
    margin-bottom: 20px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.status-item label {
    font-weight: 600;
    color: var(--secondary-color);
    min-width: 100px;
}

.tracking-id {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    text-transform: uppercase;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.processing {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.status-badge.failed {
    background: #f8d7da;
    color: #721c24;
}

.error-text {
    color: var(--danger-color);
    font-style: italic;
}

/* Progress Bar */
.progress-container {
    margin: 15px 0;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 25px;
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e9ecef;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    width: 0%;
    transition: width 0.5s ease;
    animation: progressPulse 2s infinite;
    border-radius: 10px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: 600;
    font-size: 12px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    z-index: 2;
}

.progress-details {
    margin-top: 10px;
}

.current-step {
    font-size: 14px;
    color: var(--secondary-color);
    font-weight: 500;
    margin-bottom: 5px;
}

.video-counter {
    font-size: 12px;
    color: #7f8c8d;
    background: #f8f9fa;
    padding: 5px 10px;
    border-radius: 15px;
    display: inline-block;
}

@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Job History */
.job-history {
    max-height: 300px;
    overflow-y: auto;
}

.job-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    border-left: 4px solid var(--primary-color);
    cursor: pointer;
    transition: var(--transition);
}

.job-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.job-info h4 {
    margin-bottom: 5px;
    color: var(--secondary-color);
}

.job-meta {
    font-size: 0.9em;
    color: #7f8c8d;
}

.no-jobs {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 20px;
}

/* Lookup Section */
.lookup-section {
    background: white;
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.lookup-section h3 {
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.lookup-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.lookup-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
}

.lookup-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 15px 20px;
    margin-bottom: 10px;
    border-left: 4px solid;
    min-width: 300px;
    transform: translateX(100%);
    opacity: 0;
    transition: var(--transition);
}

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

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.info {
    border-left-color: var(--primary-color);
}

.toast-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    margin-bottom: 5px;
}

.toast-body {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.loading-spinner i {
    font-size: 2em;
    color: var(--primary-color);
    margin-bottom: 15px;
    display: block;
}

.loading-spinner p {
    color: var(--secondary-color);
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .lookup-form {
        flex-direction: column;
    }
    
    .lookup-input {
        width: 100%;
    }
    
    .status-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .status-item label {
        min-width: auto;
    }
    
    .job-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .url-input-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

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

.card {
    animation: fadeIn 0.5s ease-out;
}

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

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

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Uploaded Videos Section Styles */
.uploaded-video-item {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.uploaded-video-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0.05) 100%);
    pointer-events: none;
}

.uploaded-video-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.video-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    backdrop-filter: blur(10px);
}

.video-thumbnail i {
    font-size: 24px;
    color: white;
}

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

.video-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
    word-break: break-word;
}

.video-details {
    display: flex;
    gap: 20px;
    font-size: 14px;
    opacity: 0.9;
}

.video-details span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-details i {
    font-size: 12px;
}

.video-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: white;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

/* Enhanced no-files message */
.no-files {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
    font-size: 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 2px dashed #dee2e6;
    margin: 0;
}

.no-files::before {
    content: '📁';
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
}

/* Uploaded Videos Card Enhancement */
#joinFilesList .uploaded-video-item:nth-child(even) {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

#joinFilesList .uploaded-video-item:nth-child(odd) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
