/* Estilos para la zona de carga de archivos con drag & drop */
.file-upload-container {
    position: relative;
}

.file-upload-dropzone {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    text-align: center;
    background-color: #f7fafc;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.file-upload-dropzone:hover {
    border-color: #007bff;
    background-color: #e7f3ff;
}

.file-upload-dropzone.drag-over {
    border-color: #007bff;
    background-color: #cfe2ff;
    transform: scale(1.02);
}

.file-upload-dropzone.dropzone-error {
    border-color: #dc3545 !important;
    background-color: #fff5f5 !important;
    animation: dropzone-shake 0.4s ease-in-out;
}

@keyframes dropzone-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.file-upload-dropzone.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.file-upload-icon {
    font-size: 2rem;
    color: #007bff;
    margin-bottom: 0.5rem;
}

.file-upload-text {
    color: #4a5568;
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.file-upload-hint {
    color: #718096;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.file-upload-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    top: 0;
    left: 0;
    cursor: pointer;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
    /* Asegurar que el input esté presente en el DOM y sea reconocido por el formulario */
    visibility: hidden;
}

.file-upload-button {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.4rem 1.2rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background-color 0.3s ease;
    position: relative;
    z-index: 2;
}

.file-upload-button:hover {
    background-color: #0056b3;
}

/* Lista de archivos seleccionados */
.file-list {
    margin-top: 1rem;
    display: none;
}

.file-list.has-files {
    display: block;
}

.file-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 0.35rem;
    transition: all 0.2s ease;
}

.file-list-item:hover {
    background-color: #e9ecef;
}

.file-list-item-info {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
}

.file-list-item-icon {
    font-size: 1.1rem;
    color: #007bff;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.file-list-item-details {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.file-list-item-name {
    font-weight: 500;
    color: #212529;
    margin-bottom: 0;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    line-height: 1.3;
}

.file-list-item-size {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 0.1rem;
}

.file-list-item-remove {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    transition: color 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.5rem;
    line-height: 1;
}

.file-list-item-remove:hover {
    color: #c82333;
}

.file-list-empty {
    text-align: center;
    padding: 1rem;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Mensajes de error/validación */
.file-upload-error {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 4px;
    font-size: 0.875rem;
    display: none;
}

.file-upload-error.show {
    display: block;
}

/* Indicador de carga */
.file-upload-loading {
    display: none;
    text-align: center;
    padding: 1rem;
    color: #007bff;
}

.file-upload-loading.show {
    display: block;
}

/* Límites de archivos */
.file-upload-limits {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.file-upload-count {
    font-weight: 500;
    color: #007bff;
}

/* Responsive */
@media (max-width: 768px) {
    .file-upload-dropzone {
        padding: 0.75rem 1rem;
        min-height: 100px;
    }
    
    .file-upload-icon {
        font-size: 1.5rem;
        margin-bottom: 0.25rem;
    }
    
    .file-upload-text {
        font-size: 0.85rem;
    }
    
    .file-upload-hint {
        font-size: 0.75rem;
    }
    
    .file-upload-button {
        padding: 0.35rem 1rem;
        font-size: 0.75rem;
    }
    
    .file-list-item {
        padding: 0.5rem;
    }
    
    .file-list-item-name {
        font-size: 0.875rem;
    }
}

