/**
 * Merge & Split Modal Styles
 */

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.modal-body {
    padding: 1.5rem;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Merge Upload Area */
.merge-upload-area {
    margin-bottom: 1.5rem;
}

.merge-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    border: 3px dashed #667eea;
    border-radius: 12px;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s;
}

.merge-upload-label:hover {
    border-color: #764ba2;
    background: #f0f2ff;
    transform: translateY(-2px);
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.upload-text {
    text-align: center;
    color: #495057;
}

.upload-text strong {
    color: #667eea;
    font-size: 1.1rem;
}

/* Merge Files List */
.merge-files-list {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.merge-files-list h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #495057;
    font-size: 1rem;
}

#mergeFilesContainer {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.merge-file-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: move;
    transition: all 0.2s;
}

.merge-file-item:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.merge-file-item.dragging {
    opacity: 0.5;
    transform: scale(0.95);
}

.file-drag-handle {
    font-size: 1.2rem;
    color: #adb5bd;
    cursor: grab;
}

.file-drag-handle:active {
    cursor: grabbing;
}

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

.file-icon {
    font-size: 1.5rem;
}

.file-info {
    flex: 1;
    overflow: hidden;
}

.file-info strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #212529;
}

.file-info small {
    color: #6c757d;
    font-size: 0.85rem;
}

.btn-remove {
    background: #dc3545;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

/* Merge Actions */
.merge-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn-large {
    flex: 1;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Split Method Selector */
.split-method-selector {
    margin: 1.5rem 0;
}

.split-method-selector h4 {
    margin-bottom: 0.75rem;
    color: #495057;
    font-size: 1rem;
}

.split-methods {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.split-method-btn {
    flex: 1;
    min-width: 150px;
    padding: 0.75rem 1rem;
    background: white;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.split-method-btn:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

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

/* Split Method Content */
.split-method-content {
    margin-top: 1.5rem;
}

.split-method-content label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Split Preview */
.split-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.split-preview h5 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: #495057;
    font-size: 0.95rem;
}

.split-preview-files {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.split-preview-file {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    font-size: 0.9rem;
}

/* Split Actions */
.split-actions {
    margin-top: 1.5rem;
}

.split-info {
    padding: 1rem;
    background: #e7f3ff;
    border-left: 4px solid #667eea;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.split-info p {
    margin: 0.5rem 0;
}

.split-info strong {
    color: #667eea;
}

/* Split Download List */
.split-download-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
    max-height: 400px;
    overflow-y: auto;
}

.split-download-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.split-download-item .file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Button Styles */
.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

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

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .merge-upload-label {
        padding: 1.5rem;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    .split-methods {
        flex-direction: column;
    }
    
    .split-method-btn {
        min-width: 100%;
    }
    
    .merge-actions {
        flex-direction: column;
    }
    
    .file-info strong {
        font-size: 0.9rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .modal-content {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    .modal-body {
        background: #1e1e1e;
    }
    
    .merge-upload-label {
        background: #2a2a2a;
        border-color: #667eea;
    }
    
    .merge-upload-label:hover {
        background: #333;
    }
    
    .merge-files-list {
        background: #2a2a2a;
    }
    
    .merge-file-item {
        background: #333;
        border-color: #444;
    }
    
    .form-input {
        background: #2a2a2a;
        border-color: #444;
        color: #e0e0e0;
    }
    
    .split-preview {
        background: #2a2a2a;
    }
    
    .split-preview-file {
        background: #333;
    }
    
    .split-info {
        background: #2a3a4a;
        border-color: #667eea;
    }
}
