/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e5eb;
}

header h1 {
    color: #e74c3c;
    font-size: 2.2rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.subtitle {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 15px;
}

.note {
    background-color: #e8f4fd;
    border-left: 4px solid #3498db;
    padding: 10px 15px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 0.9rem;
}

.note i {
    color: #3498db;
    font-size: 1rem;
}

/* Main Sections */
main {
    flex: 1;
}

section {
    margin-bottom: 25px;
}

/* Upload Section - ADJUSTED SIZE */
.upload-section {
    margin-bottom: 25px;
}

.upload-area {
    background-color: white;
    border: 3px dashed #a0aec0;
    border-radius: 10px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.upload-area:hover, .upload-area.dragover {
    border-color: #3498db;
    background-color: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.1);
}

.upload-area i {
    font-size: 2.8rem;
    color: #a0aec0;
    margin-bottom: 15px;
    transition: color 0.3s;
}

.upload-area:hover i {
    color: #3498db;
}

.upload-area h2 {
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.upload-area p {
    color: #718096;
    margin-bottom: 20px;
    font-size: 1rem;
    line-height: 1.4;
}

#fileInput {
    display: none;
}

.browse-btn {
    background-color: #3498db;
    color: white;
    padding: 10px 25px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: inline-block;
    transition: background-color 0.3s;
    border: none;
    font-size: 0.95rem;
    margin-top: 5px;
}

.browse-btn:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.file-info {
    margin-top: 15px;
    font-size: 0.85rem;
    color: #94a3b8;
}

/* Files Section */
.files-section h2 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

#fileCount {
    color: #718096;
    font-weight: normal;
    font-size: 1.1rem;
}

.section-info {
    color: #718096;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.files-list {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    min-height: 120px;
    max-height: 400px;
    overflow-y: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    color: #a0aec0;
    text-align: center;
}

.empty-state i {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 1rem;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 12px;
    background-color: #f8fafc;
    transition: transform 0.2s, box-shadow 0.2s;
}

.file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.file-item.dragging {
    opacity: 0.5;
    border: 2px dashed #3498db;
}

.file-icon {
    background-color: #e74c3c;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
}

.file-icon i {
    font-size: 1.3rem;
}

.file-info-container {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
    word-break: break-word;
    font-size: 0.95rem;
}

.file-size {
    color: #718096;
    font-size: 0.85rem;
}

.file-order {
    font-weight: bold;
    color: #3498db;
    font-size: 1.1rem;
    margin-right: 15px;
    min-width: 30px;
    text-align: center;
}

.file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.file-btn {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.file-btn:hover {
    background-color: #f1f5f9;
}

.file-btn.up:hover {
    color: #2ecc71;
    border-color: #2ecc71;
}

.file-btn.down:hover {
    color: #3498db;
    border-color: #3498db;
}

.file-btn.remove:hover {
    color: #e74c3c;
    border-color: #e74c3c;
}

.file-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Action Buttons */
.actions-section {
    margin-top: 30px;
}

.action-buttons {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    transition: all 0.3s;
}

.primary-btn {
    background-color: #3498db;
    color: white;
}

.primary-btn:hover:not(:disabled) {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.secondary-btn {
    background-color: #f1f5f9;
    color: #4a5568;
    border: 1px solid #cbd5e0;
}

.secondary-btn:hover:not(:disabled) {
    background-color: #e2e8f0;
}

.success-btn {
    background-color: #2ecc71;
    color: white;
}

.success-btn:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Download Section */
.download-section {
    display: none;
}

.download-card {
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.08);
    border-top: 5px solid #2ecc71;
}

.download-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.download-header i {
    font-size: 2.2rem;
    color: #2ecc71;
}

.download-header h3 {
    color: #2d3748;
    font-size: 1.5rem;
}

.download-info {
    background-color: #f8fafc;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.download-info p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #4a5568;
    font-size: 0.95rem;
}

.download-info i {
    color: #2ecc71;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 30px;
    border-top: 1px solid #e1e5eb;
    color: #6c757d;
    font-size: 0.9rem;
}

footer i.fa-heart {
    color: #e74c3c;
    margin: 0 5px;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    max-width: 350px;
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f1f5f9;
    border-top-color: #3498db;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h3 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.loading-content p {
    color: #718096;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.progress-bar {
    height: 8px;
    background-color: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background-color: #3498db;
    width: 0%;
    transition: width 0.3s;
}

.progress-text {
    font-weight: 600;
    color: #3498db;
    font-size: 0.9rem;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background-color: white;
    border-radius: 8px;
    padding: 14px 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 320px;
    animation: slideIn 0.3s ease-out;
    border-left: 4px solid #3498db;
}

.toast.error {
    border-left-color: #e74c3c;
}

.toast.success {
    border-left-color: #2ecc71;
}

.toast i {
    font-size: 1.3rem;
}

.toast .fa-info-circle {
    color: #3498db;
}

.toast .fa-exclamation-circle {
    color: #e74c3c;
}

.toast .fa-check-circle {
    color: #2ecc71;
}

.toast-content {
    flex: 1;
}

.toast-content h4 {
    color: #2d3748;
    margin-bottom: 4px;
    font-size: 1rem;
}

.toast-content p {
    color: #718096;
    font-size: 0.85rem;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.8rem;
        flex-direction: column;
        gap: 8px;
    }
    
    .upload-area {
        padding: 25px 15px;
        min-height: 160px;
    }
    
    .upload-area i {
        font-size: 2.2rem;
        margin-bottom: 12px;
    }
    
    .upload-area h2 {
        font-size: 1.3rem;
    }
    
    .upload-area p {
        font-size: 0.9rem;
        margin-bottom: 15px;
    }
    
    .browse-btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        padding: 12px 20px;
    }
    
    .file-item {
        flex-wrap: wrap;
        padding: 12px;
    }
    
    .file-order {
        margin-right: 10px;
    }
    
    .file-actions {
        margin-top: 10px;
        width: 100%;
        justify-content: center;
    }
    
    .download-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .download-header h3 {
        font-size: 1.3rem;
    }
    
    .toast-container {
        left: 15px;
        right: 15px;
        max-width: calc(100% - 30px);
    }
}

/* Scrollbar styling for files list */
.files-list::-webkit-scrollbar {
    width: 8px;
}

.files-list::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.files-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 4px;
}

.files-list::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}