* {
    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;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

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

.upload-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.dropzone {
    border: 3px dashed #667eea;
    border-radius: 8px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9ff;
}

.dropzone:hover, .dropzone.dragover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: scale(1.02);
}

.dropzone-content svg {
    color: #667eea;
    margin-bottom: 20px;
}

.dropzone-content p {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 10px;
}

.or-text {
    color: #999;
    font-size: 0.9rem;
    margin: 15px 0;
}

.browse-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.browse-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.videos-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 30px;
}

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

.section-header h2 {
    color: #333;
    font-size: 1.5rem;
}

.merge-btn-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.merge-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.merge-btn:hover:not(:disabled) {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.3);
}

.merge-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.video-card {
    background: #f9fafb;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: all 0.3s ease;
    cursor: move;
}

.video-card:hover {
    border-color: #667eea;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
}

.video-card.sortable-ghost {
    opacity: 0.4;
}

.video-card.sortable-drag {
    opacity: 0.8;
}

.drag-handle {
    color: #9ca3af;
    font-size: 1.5rem;
    cursor: move;
    user-select: none;
}

.video-number {
    background: #667eea;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
}

.video-preview {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    background: #e5e7eb;
}

.video-info {
    flex: 1;
}

.video-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    word-break: break-all;
}

.video-size {
    color: #6b7280;
    font-size: 0.9rem;
}

.remove-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-btn:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.status-section {
    background: white;
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.status-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
}

.spinner-container {
    position: relative;
    width: 100px;
    height: 100px;
}

.spinner {
    width: 100px;
    height: 100px;
    border: 6px solid #f3f4f6;
    border-top: 6px solid #667eea;
    border-right: 6px solid #764ba2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#statusTitle {
    font-size: 2rem;
    color: #667eea;
    margin: 0;
    font-weight: 600;
}

#statusText {
    font-size: 1.2rem;
    color: #4b5563;
    margin: 0;
}

.processing-info {
    margin-top: 20px;
    color: #6b7280;
    font-size: 1rem;
}

.processing-info p {
    margin-bottom: 20px;
}

.dots-loader {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.dots-loader span {
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dots-loader span:nth-child(1) {
    animation-delay: -0.32s;
}

.dots-loader span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% { 
        transform: scale(0);
        opacity: 0.5;
    }
    40% { 
        transform: scale(1);
        opacity: 1;
    }
}

.result-section {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.result-content h3 {
    color: #10b981;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.merged-video-player {
    width: 100%;
    max-width: 800px;
    border-radius: 8px;
    margin-bottom: 30px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-btn {
    display: inline-block;
    background: #667eea;
    color: white;
    text-decoration: none;
    padding: 15px 40px;
    border-radius: 6px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.secondary-btn {
    background: #6b7280;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-btn:hover {
    background: #4b5563;
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

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

    .video-card {
        flex-direction: column;
        text-align: center;
    }

    .video-preview {
        width: 100%;
        height: 180px;
    }
}
