/* Modal Upload */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 16px;
    padding: 35px;
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideDown 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-title {
    font-size: 1.6rem;
    color: #333;
    font-weight: 700;
}

.modal-close {
    background: #f0f0f0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #666;
}

.modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
    color: #333;
}

.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
}

.form-select {
    width: 100%;
    padding: 13px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    cursor: pointer;
}

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

.form-input {
    width: 100%;
    padding: 13px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

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

.file-input-wrapper {
    position: relative;
    width: 100%;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px 20px;
    border: 3px dashed #667eea;
    border-radius: 12px;
    background: linear-gradient(135deg, #f8f9ff 0%, #eef1ff 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    color: #667eea;
    font-weight: 600;
}

.file-input-label:hover {
    background: linear-gradient(135deg, #eef1ff 0%, #e3e7ff 100%);
    border-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.file-input {
    display: none;
}

.file-preview {
    margin-top: 15px;
    padding: 12px 15px;
    background: #f8f9ff;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #555;
    display: none;
    border-left: 4px solid #667eea;
}

.file-preview.active {
    display: block;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

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

.submit-btn:disabled {
    background: linear-gradient(135deg, #ccc 0%, #aaa 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.new-category-input {
    display: none;
    margin-top: 12px;
}

.new-category-input.active {
    display: block;
}

.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert::before {
    font-size: 1.3rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-success::before {
    content: '✓';
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-error::before {
    content: '✕';
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 15px;
    display: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar.active {
    display: block;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 10px;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        padding: 25px;
        max-width: 95%;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    .file-input-label {
        padding: 25px 15px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 20px;
        border-radius: 12px;
    }

    .modal-title {
        font-size: 1.3rem;
    }

    .file-input-label {
        padding: 20px 12px;
        font-size: 0.9rem;
    }
}
