* {
    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;
    line-height: 1.6;
    color: #333;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 300;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.upload-section {
    padding: 40px;
}

.file-upload-area {
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    position: relative;
}

.file-upload-area:hover {
    border-color: #667eea;
    background-color: #f8f9ff;
}

.file-upload-area.dragover {
    border-color: #667eea;
    background-color: #f0f2ff;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.7;
}

.file-upload-area h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
}

.file-upload-area p {
    color: #666;
    margin-bottom: 20px;
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.browse-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.file-list {
    margin-bottom: 30px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.file-info {
    display: flex;
    flex-direction: column;
}

.file-name {
    font-weight: 600;
    color: #333;
}

.file-size {
    font-size: 0.9rem;
    color: #666;
}

.remove-file {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: #c82333;
    transform: scale(1.1);
}

.upload-options {
    margin-bottom: 30px;
}

.option-group {
    margin-bottom: 20px;
}

.option-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.option-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.option-group input[type="text"]:focus {
    border-color: #667eea;
    outline: none;
}

.option-group small {
    color: #666;
    font-size: 0.9rem;
}

.merge-btn {
    width: 100%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.merge-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.merge-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.limits-info {
    background: #f8f9fa;
    padding: 30px 40px;
    border-top: 1px solid #eee;
}

.limits-info h4 {
    margin-bottom: 15px;
    color: #495057;
}

.limits-info ul {
    list-style: none;
}

.limits-info li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.limits-info li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #28a745;
    font-weight: bold;
}

.result-section {
    padding: 40px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    text-align: center;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.download-link {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    margin: 10px;
}

.download-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .upload-section {
        padding: 20px;
    }
    
    .file-upload-area {
        padding: 30px 20px;
    }
    
    .upload-icon {
        font-size: 3rem;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .limits-info {
        padding: 20px;
    }
    
    .result-section {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }
    
    .file-upload-area {
        padding: 20px 15px;
    }
    
    .upload-icon {
        font-size: 2.5rem;
    }
    
    .browse-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}